diff --git a/src/app/panels/file-panel.js b/src/app/panels/file-panel.js index f95b5e2e5a..f3f4910cb8 100644 --- a/src/app/panels/file-panel.js +++ b/src/app/panels/file-panel.js @@ -55,29 +55,37 @@ module.exports = class Filepanel extends ViewPlugin { var fileExplorer = new FileExplorer(self._components.registry, self._deps.fileProviders['browser'], ['createNewFile', 'publishToGist', 'copyFiles', canUpload ? 'uploadFile' : ''] ) - var fileSystemExplorer = new FileExplorer(self._components.registry, self._deps.fileProviders['localhost']) - var swarmExplorer = new FileExplorer(self._components.registry, self._deps.fileProviders['swarm']) - var githubExplorer = new FileExplorer(self._components.registry, self._deps.fileProviders['github']) - var gistExplorer = new FileExplorer(self._components.registry, self._deps.fileProviders['gist'], ['updateGist']) - var httpExplorer = new FileExplorer(self._components.registry, self._deps.fileProviders['http']) - var httpsExplorer = new FileExplorer(self._components.registry, self._deps.fileProviders['https']) - var ipfsExplorer = new FileExplorer(self._components.registry, self._deps.fileProviders['ipfs']) + + function createProvider(key) { + return new FileExplorer(self._components.registry, self._deps.fileProviders[key]) + } + + var fileSystemExplorer = createProvider('localhost') + var swarmExplorer = createProvider('swarm') + var githubExplorer = createProvider('github') + var gistExplorer = createProvider('updateGist') + var httpExplorer = createProvider('http') + var httpsExplorer = createProvider('https') + var httpsExplorer = createProvider('ipfs') self.remixdHandle = new RemixdHandle(fileSystemExplorer, self._deps.fileProviders['localhost'], appManager) + const explorers = yo` +