diff --git a/apps/remix-ide/src/app/files/fileManager.ts b/apps/remix-ide/src/app/files/fileManager.ts index 9c11b5863d..2ad2ea4aa9 100644 --- a/apps/remix-ide/src/app/files/fileManager.ts +++ b/apps/remix-ide/src/app/files/fileManager.ts @@ -608,9 +608,10 @@ class FileManager extends Plugin { this.events.emit('noFileSelected') } else { file = this.normalize(file) - await this.saveCurrentFile() const resolved = this.getPathFromUrl(file) file = resolved.file + await this.saveCurrentFile() + if (this.currentFile() === file) return const provider = resolved.provider this._deps.config.set('currentFile', file) this.openedFiles[file] = file