From 5bc6cabf299a9b5f1b149349b4f135dfe378534b Mon Sep 17 00:00:00 2001 From: yann300 Date: Mon, 28 Feb 2022 14:49:20 +0100 Subject: [PATCH] switch file only if necessary --- apps/remix-ide/src/app/files/fileManager.ts | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) 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