From b1173e6d65f38275a8c2c6a22e458a9428506494 Mon Sep 17 00:00:00 2001 From: Grandschtroumpf Date: Thu, 14 Mar 2019 16:01:42 +0100 Subject: [PATCH] quick fix --- src/app/files/fileManager.js | 28 ++++++++++++++-------------- 1 file changed, 14 insertions(+), 14 deletions(-) diff --git a/src/app/files/fileManager.js b/src/app/files/fileManager.js index c6c755514d..63966ba15f 100644 --- a/src/app/files/fileManager.js +++ b/src/app/files/fileManager.js @@ -164,20 +164,6 @@ class FileManager extends ApiFactory { } switchFile (file) { - if (file) return _switchFile(file) - else { - var browserProvider = this._deps.filesProviders['browser'] - browserProvider.resolveDirectory('browser', (error, filesTree) => { - if (error) console.error(error) - var fileList = Object.keys(filesTree) - if (fileList.length) { - _switchFile(browserProvider.type + '/' + fileList[0]) - } else { - this.events.emit('currentFileChanged') - this._deps.editor.displayEmptyReadOnlySession() - } - }) - } const _switchFile = (file) => { this.saveCurrentFile() this._deps.config.set('currentFile', file) @@ -195,6 +181,20 @@ class FileManager extends ApiFactory { } }) } + if (file) return _switchFile(file) + else { + var browserProvider = this._deps.filesProviders['browser'] + browserProvider.resolveDirectory('browser', (error, filesTree) => { + if (error) console.error(error) + var fileList = Object.keys(filesTree) + if (fileList.length) { + _switchFile(browserProvider.type + '/' + fileList[0]) + } else { + this.events.emit('currentFileChanged') + this._deps.editor.displayEmptyReadOnlySession() + } + }) + } } getFilesFromPath (path) {