From 935b67f0dec049989d3cb586d537234cd88fe4cf Mon Sep 17 00:00:00 2001 From: filip mertens Date: Mon, 25 Jan 2021 16:34:21 +0100 Subject: [PATCH] file events from provider didn't trigger fileman rm event --- apps/remix-ide/src/app/files/fileManager.js | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/apps/remix-ide/src/app/files/fileManager.js b/apps/remix-ide/src/app/files/fileManager.js index af188cd1bf..2736353a15 100644 --- a/apps/remix-ide/src/app/files/fileManager.js +++ b/apps/remix-ide/src/app/files/fileManager.js @@ -271,6 +271,7 @@ class FileManager extends Plugin { this._deps.browserExplorer.event.register('fileRenamed', (oldName, newName, isFolder) => { this.fileRenamedEvent(oldName, newName, isFolder) }) this._deps.localhostExplorer.event.register('fileRenamed', (oldName, newName, isFolder) => { this.fileRenamedEvent(oldName, newName, isFolder) }) this._deps.browserExplorer.event.register('fileRemoved', (path) => { this.fileRemovedEvent(path) }) + this._deps.browserExplorer.event.register('fileAdded', (path) => { this.fileAddedEvent(path) }) this._deps.localhostExplorer.event.register('fileRemoved', (path) => { this.fileRemovedEvent(path) }) this._deps.localhostExplorer.event.register('errored', (event) => { this.removeTabsOf(this._deps.localhostExplorer) }) this._deps.localhostExplorer.event.register('closed', (event) => { this.removeTabsOf(this._deps.localhostExplorer) }) @@ -281,9 +282,12 @@ class FileManager extends Plugin { this.switchFile = this.open } + fileAddedEvent (path) { + this.emit('fileAdded', path) + } + fileChangedEvent (path) { - // @todo(#2386) use only for discard changes function. - // this.syncEditor(path) + this.emit('currentFileChanged', path) } fileRenamedEvent (oldName, newName, isFolder) {