diff --git a/src/app/files/fileManager.js b/src/app/files/fileManager.js index 3bcdf045f3..46755b2de3 100644 --- a/src/app/files/fileManager.js +++ b/src/app/files/fileManager.js @@ -40,6 +40,9 @@ class FileManager { self._deps.localhostExplorer.event.register('fileRemoved', (path) => { this.fileRemovedEvent(path) }) self._deps.configExplorer.event.register('fileRemoved', (path) => { this.fileRemovedEvent(path) }) self._deps.gistExplorer.event.register('fileRemoved', (path) => { this.fileRemovedEvent(path) }) + + self._deps.localhostExplorer.event.register('errored', (event) => { this.removeTabsOf(self._deps.localhostExplorer) }) + self._deps.localhostExplorer.event.register('closed', (event) => { this.removeTabsOf(self._deps.localhostExplorer) }) } fileRenamedEvent (oldName, newName, isFolder) { diff --git a/src/app/files/shared-folder.js b/src/app/files/shared-folder.js index bc3c57fb6a..43bcce4bc1 100644 --- a/src/app/files/shared-folder.js +++ b/src/app/files/shared-folder.js @@ -14,6 +14,13 @@ module.exports = class SharedFolder { this.filesContent = {} this.files = {} + var remixdEvents = ['connecting', 'connected', 'errored', 'closed'] + remixdEvents.forEach((value) => { + remixd.event.register(value, (event) => { + this.event.trigger(value, [event]) + }) + }) + remixd.event.register('notified', (data) => { if (data.scope === 'sharedfolder') { if (data.name === 'created') { diff --git a/src/app/panels/file-panel.js b/src/app/panels/file-panel.js index 51e8caff67..b6f38b763c 100644 --- a/src/app/panels/file-panel.js +++ b/src/app/panels/file-panel.js @@ -143,24 +143,24 @@ function filepanel (localRegistry) { fileExplorer.ensureRoot() configExplorer.ensureRoot() var websocketconn = element.querySelector('.websocketconn') - self._deps.fileProviders['localhost'].remixd.event.register('connecting', (event) => { + self._deps.fileProviders['localhost'].event.register('connecting', (event) => { websocketconn.style.color = styles.colors.yellow websocketconn.setAttribute('title', 'Connecting to localhost. ' + JSON.stringify(event)) }) - self._deps.fileProviders['localhost'].remixd.event.register('connected', (event) => { + self._deps.fileProviders['localhost'].event.register('connected', (event) => { websocketconn.style.color = styles.colors.green websocketconn.setAttribute('title', 'Connected to localhost. ' + JSON.stringify(event)) fileSystemExplorer.show() }) - self._deps.fileProviders['localhost'].remixd.event.register('errored', (event) => { + self._deps.fileProviders['localhost'].event.register('errored', (event) => { websocketconn.style.color = styles.colors.red websocketconn.setAttribute('title', 'localhost connection errored. ' + JSON.stringify(event)) fileSystemExplorer.hide() }) - self._deps.fileProviders['localhost'].remixd.event.register('closed', (event) => { + self._deps.fileProviders['localhost'].event.register('closed', (event) => { websocketconn.style.color = styles.colors.black websocketconn.setAttribute('title', 'localhost connection closed. ' + JSON.stringify(event)) fileSystemExplorer.hide()