switch to learneth workspace

pull/1096/head
yann300 4 years ago
parent fe6d057d32
commit 16944a83df
  1. 1
      apps/remix-ide/src/app.js
  2. 13
      apps/remix-ide/src/app/panels/file-panel.js
  3. 4
      apps/remix-ide/src/remixAppManager.js
  4. 4
      libs/remix-ui/workspace/src/lib/remix-ui-workspace.tsx

@ -480,6 +480,7 @@ Please make a backup of your contracts and start using http://remix.ethereum.org
appManager.call(...callDetails).catch(console.error)
}
}
appManager.finishActivation()
}).catch(console.error)
} else {
// activate solidity plugin

@ -48,6 +48,7 @@ module.exports = class Filepanel extends ViewPlugin {
constructor (appManager) {
super(profile)
this.event = new EventManager()
this.appManager = appManager
this._components = {}
this._components.registry = globalRegistry
this._deps = {
@ -136,6 +137,18 @@ module.exports = class Filepanel extends ViewPlugin {
}
async initWorkspace () {
this.on('manager', 'activationFinished', () => {
this.on('manager', 'pluginActivated', async (profile) => {
if (profile.name === 'LearnEth') {
const name = "learneth"
if (!this.workspaces.includes(name)) {
await this.processCreateWorkspace(name)
this.getWorkspaces()
}
return await this.request.setWorkspace(name)
}
})
})
const queryParams = new QueryParams()
const gistHandler = new GistHandler()
const params = queryParams.get()

@ -65,6 +65,10 @@ export class RemixAppManager extends PluginManager {
return await this.permissionHandler.askPermission(this.profiles[from], this.profiles[to], method, message)
}
finishActivation () {
this.emit('activationFinished')
}
onPluginActivated (plugin) {
this.pluginLoader.set(plugin, this.actives)
this.event.emit('activate', plugin)

@ -44,6 +44,10 @@ export const Workspace = (props: WorkspaceProps) => {
props.plugin.resetUploadFile = () => {}
/* implement an external API, consumed by the parent */
props.request.setWorkspace = (name: string) => {
setWorkspace(name)
}
props.request.createWorkspace = () => {
return createWorkspace()
}

Loading…
Cancel
Save