Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions apps/remix-ide/src/app.js
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
13 changes: 13 additions & 0 deletions apps/remix-ide/src/app/panels/file-panel.js
Original file line number Diff line number Diff line change
Expand Up @@ -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 = {
Expand Down Expand Up @@ -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()
Expand Down
4 changes: 4 additions & 0 deletions apps/remix-ide/src/remixAppManager.js
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
4 changes: 4 additions & 0 deletions libs/remix-ui/workspace/src/lib/remix-ui-workspace.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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()
}
Expand Down