diff --git a/apps/remix-ide/src/app/files/fileManager.ts b/apps/remix-ide/src/app/files/fileManager.ts index 071d1b96b1..d9e043fa67 100644 --- a/apps/remix-ide/src/app/files/fileManager.ts +++ b/apps/remix-ide/src/app/files/fileManager.ts @@ -484,7 +484,7 @@ class FileManager extends Plugin { this.emit('filesAllClosed') this.events.emit('filesAllClosed') for (const file in this.openedFiles) { - this.closeFile(file) + await this.closeFile(file) } } diff --git a/apps/remix-ide/src/app/panels/tab-proxy.js b/apps/remix-ide/src/app/panels/tab-proxy.js index bc8a7c4c8f..7e4ce18a22 100644 --- a/apps/remix-ide/src/app/panels/tab-proxy.js +++ b/apps/remix-ide/src/app/panels/tab-proxy.js @@ -50,10 +50,18 @@ export class TabProxy extends Plugin { this.on('fileManager', 'fileClosed', (name) => { const workspace = this.fileManager.currentWorkspace() - if (this.fileManager.mode === 'browser') { name = name.startsWith(workspace + '/') ? name : workspace + '/' + name - this.removeTab(name) + let tabIndex = this.loadedTabs.findIndex(tab => tab.name === name) + + // If tab doesn't exist, check if tab is opened because of abrupt disconnection with remixd + if (tabIndex === -1) { + const nameArray = name.split('/') + nameArray.shift() + name = 'localhost' + '/' + nameArray.join('/') + tabIndex = this.loadedTabs.findIndex(tab => tab.name === name) + if(tabIndex !== -1) this.removeTab(name) + } else this.removeTab(name) } else { name = name.startsWith(this.fileManager.mode + '/') ? name : this.fileManager.mode + '/' + name this.removeTab(name) diff --git a/apps/remix-ide/src/app/plugins/remixd-handle.tsx b/apps/remix-ide/src/app/plugins/remixd-handle.tsx index 3b707f0534..5ad5d25e60 100644 --- a/apps/remix-ide/src/app/plugins/remixd-handle.tsx +++ b/apps/remix-ide/src/app/plugins/remixd-handle.tsx @@ -76,10 +76,9 @@ export class RemixdHandle extends WebsocketPlugin { const intervalId = setInterval(() => { if (!this.socket || (this.socket && this.socket.readyState === 3)) { // 3 means connection closed clearInterval(intervalId) - console.log(error) const alert:AlertModal = { id: 'connectionAlert', - message: 'Connection to remixd terminated.Please make sure remixd is still running in the background.' + message: 'Connection to remixd terminated. Please make sure remixd is still running in the background.' } this.call('notification', 'alert', alert) this.canceled() diff --git a/libs/remix-ui/solidity-compiler/src/lib/compiler-container.tsx b/libs/remix-ui/solidity-compiler/src/lib/compiler-container.tsx index 80220662fc..f1fc578600 100644 --- a/libs/remix-ui/solidity-compiler/src/lib/compiler-container.tsx +++ b/libs/remix-ui/solidity-compiler/src/lib/compiler-container.tsx @@ -624,7 +624,7 @@ export const CompilerContainer = (props: CompilerContainerProps) => {