From 11b38a4e0b626f58ff1f2eb33ea1d7b7f5756067 Mon Sep 17 00:00:00 2001 From: yann300 Date: Tue, 30 Aug 2022 15:57:33 +0200 Subject: [PATCH 1/2] ensure ExecutionContext is inited with 'vm' --- apps/remix-ide/src/blockchain/execution-context.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/apps/remix-ide/src/blockchain/execution-context.js b/apps/remix-ide/src/blockchain/execution-context.js index e210793c1c..0b63c241cd 100644 --- a/apps/remix-ide/src/blockchain/execution-context.js +++ b/apps/remix-ide/src/blockchain/execution-context.js @@ -20,7 +20,7 @@ if (typeof window !== 'undefined' && typeof window.ethereum !== 'undefined') { export class ExecutionContext { constructor () { this.event = new EventManager() - this.executionContext = null + this.executionContext = 'vm' this.lastBlock = null this.blockGasLimitDefault = 4300000 this.blockGasLimit = this.blockGasLimitDefault From 44b716be6ef81e0936121b287e5e9f90e3720caa Mon Sep 17 00:00:00 2001 From: yann300 Date: Tue, 30 Aug 2022 15:57:51 +0200 Subject: [PATCH 2/2] set current workspace to the first one by default --- libs/remix-ui/workspace/src/lib/remix-ui-workspace.tsx | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/libs/remix-ui/workspace/src/lib/remix-ui-workspace.tsx b/libs/remix-ui/workspace/src/lib/remix-ui-workspace.tsx index 7aef284f10..ef4ac18ad0 100644 --- a/libs/remix-ui/workspace/src/lib/remix-ui-workspace.tsx +++ b/libs/remix-ui/workspace/src/lib/remix-ui-workspace.tsx @@ -26,7 +26,11 @@ export function Workspace () { const initGitRepoRef = useRef() useEffect(() => { - setCurrentWorkspace(localStorage.getItem('currentWorkspace') ? localStorage.getItem('currentWorkspace') : '') + let workspaceName = localStorage.getItem('currentWorkspace') + if (!workspaceName && global.fs.browser.workspaces.length) { + workspaceName = global.fs.browser.workspaces[0].name + } + setCurrentWorkspace(workspaceName) resetFocus() }, [])