diff --git a/src/app/files/fileManager.js b/src/app/files/fileManager.js index 342f9d85f2..19d64c8608 100644 --- a/src/app/files/fileManager.js +++ b/src/app/files/fileManager.js @@ -189,6 +189,12 @@ class FileManager extends FileSystemApi { this.switchFile() } + unselectCurrentFile () { + this.saveCurrentFile() + this._deps.config.set('currentFile', '') + this.events.emit('noFileSelected') + } + switchFile (file) { const _switchFile = (file) => { this.saveCurrentFile() diff --git a/src/app/panels/editor-panel.js b/src/app/panels/editor-panel.js index f6eccd3a7f..9a4d0a3814 100644 --- a/src/app/panels/editor-panel.js +++ b/src/app/panels/editor-panel.js @@ -51,11 +51,11 @@ class EditorPanel { } self.tabProxy = new TabProxy(self._deps.fileManager, self._components.editor, self.appStore, self.appManager) let showApp = function (name) { + self._deps.fileManager.unselectCurrentFile() self.mainPanelComponent.showContent(name) self._view.editor.style.display = 'none' self._components.contextView.hide() self._view.mainPanel.style.display = 'block' - self.tabProxy.sh } self.appManager.event.on('ensureActivated', (name) => { if (name === 'home') {