Merge pull request #1079 from ethereum/moreremixdfeedback

More remixd feedback
pull/1/head
yann300 7 years ago committed by GitHub
commit a76388c053
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 7
      src/app.js
  2. 2
      src/app/files/shared-folder.js
  3. 6
      src/lib/remixd.js

@ -39,6 +39,7 @@ var FileManager = require('./app/files/fileManager')
var ContextualListener = require('./app/editor/contextualListener')
var ContextView = require('./app/editor/contextView')
var BasicReadOnlyExplorer = require('./app/files/basicReadOnlyExplorer')
var toolTip = require('./app/ui/tooltip')
var styleGuide = remixLib.ui.themeChooser
var styles = styleGuide.chooser()
@ -114,7 +115,11 @@ class App {
executionContext.init(self._api.config)
self._api.filesProviders = {}
self._api.filesProviders['browser'] = new Browserfiles(fileStorage)
self._api.filesProviders['localhost'] = new SharedFolder(new Remixd())
var remixd = new Remixd()
remixd.event.register('system', (message) => {
if (message.error) toolTip(message.error)
})
self._api.filesProviders['localhost'] = new SharedFolder(remixd)
self._api.filesProviders['swarm'] = new BasicReadOnlyExplorer('swarm')
self._api.filesProviders['github'] = new BasicReadOnlyExplorer('github')
self._api.filesProviders['gist'] = new BasicReadOnlyExplorer('gist')

@ -89,7 +89,7 @@ module.exports = class SharedFolder {
set (path, content, cb) {
var unprefixedpath = this.removePrefix(path)
this._remixd.call('sharedfolder', 'set', {path: unprefixedpath, content: content}, (error, result) => {
if (cb) cb(error, result)
if (cb) return cb(error, result)
var path = this.type + '/' + unprefixedpath
this.event.trigger('fileChanged', [path])
})

@ -48,6 +48,12 @@ class Remixd {
this.event.trigger('replied', [data])
} else if (data.type === 'notification') {
this.event.trigger('notified', [data])
} else if (data.type === 'system') {
if (data.error) {
this.event.trigger('system', [{
error: data.error
}])
}
}
})

Loading…
Cancel
Save