diff --git a/apps/remix-ide/src/app/panels/layout.ts b/apps/remix-ide/src/app/panels/layout.ts index 33704eef35..37a0ee6fe4 100644 --- a/apps/remix-ide/src/app/panels/layout.ts +++ b/apps/remix-ide/src/app/panels/layout.ts @@ -57,9 +57,6 @@ export class Layout extends Plugin { this.panels.main.active = false this.event.emit('change', null) }) - this.on('tabs', 'tabCountChanged', async count => { - if (!count) await this.call('manager', 'activatePlugin', 'home') - }) this.on('manager', 'activate', (profile: Profile) => { switch (profile.name) { case 'filePanel': diff --git a/apps/remix-ide/src/app/panels/tab-proxy.js b/apps/remix-ide/src/app/panels/tab-proxy.js index cbcd542642..82758c169f 100644 --- a/apps/remix-ide/src/app/panels/tab-proxy.js +++ b/apps/remix-ide/src/app/panels/tab-proxy.js @@ -284,7 +284,7 @@ export class TabProxy extends Plugin { let previous = currentFileTab this.loadedTabs = this.loadedTabs.filter((tab, index) => { if (!previous && tab.name === name) { - if(index - 1 && this.loadedTabs[index - 1]) + if(index - 1 >= 0 && this.loadedTabs[index - 1]) previous = this.loadedTabs[index - 1] else if (index + 1 && this.loadedTabs[index + 1]) previous = this.loadedTabs[index + 1]