From bda94c960fc73982aa868ae980d688657ea7b287 Mon Sep 17 00:00:00 2001 From: Aniket-Engg Date: Fri, 13 May 2022 14:49:54 +0530 Subject: [PATCH] fix all tabs closing --- apps/remix-ide/src/app/panels/tab-proxy.js | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/apps/remix-ide/src/app/panels/tab-proxy.js b/apps/remix-ide/src/app/panels/tab-proxy.js index f9a11c2b93..d6d2b58ec0 100644 --- a/apps/remix-ide/src/app/panels/tab-proxy.js +++ b/apps/remix-ide/src/app/panels/tab-proxy.js @@ -153,6 +153,10 @@ export class TabProxy extends Plugin { displayName, () => this.emit('switchApp', name), () => { + if(name === 'home' && this.loadedTabs.length === 1 && this.loadedTabs[0].id === "home") { + const files = Object.keys(this.editor.sessions) + files.forEach(filepath => this.editor.discard(filepath)) + } this.emit('closeApp', name) this.call('manager', 'deactivatePlugin', name) },