diff --git a/libs/remix-ui/home-tab/src/lib/components/homeTabFile.tsx b/libs/remix-ui/home-tab/src/lib/components/homeTabFile.tsx index 55d8223886..3c42debe4e 100644 --- a/libs/remix-ui/home-tab/src/lib/components/homeTabFile.tsx +++ b/libs/remix-ui/home-tab/src/lib/components/homeTabFile.tsx @@ -119,22 +119,20 @@ function HomeTabFile({plugin}: HomeTabFileProps) { const workspaces = await plugin.call('filePanel', 'getWorkspaces') if (!workspaces.find(workspace => workspace.name === wName)) { await plugin.call('filePanel', 'createWorkspace', wName, 'remixDefault') - await plugin.call('filePanel', 'setWorkspace', wName) - } else { - await plugin.call('filePanel', 'switchToWorkspace', { name: wName, isLocalHost: false }) } + await plugin.call('filePanel', 'switchToWorkspace', { name: wName, isLocalHost: false }) + await plugin.call('filePanel', 'switchToWorkspace', { name: wName, isLocalHost: false }) // don't ask why - const content = `// SPDX-License-Identifier: MIT -pragma solidity >=0.7.0 <0.9.0; + const content = ` + // SPDX-License-Identifier: MIT + pragma solidity >=0.7.0 <0.9.0; -contract helloWorld { -} -` - - const {newContent, newPath} = await plugin.call('fileManager', 'writeFileNoRewrite', '/contracts/helloWorld.sol', content) + contract helloWorld { + } + ` + const {newPath} = await plugin.call('fileManager', 'writeFileNoRewrite', '/contracts/helloWorld.sol', content) await plugin.call('fileManager', 'open', newPath) } - const uploadFile = async (target) => { _paq.push(['trackEvent', 'hometab', 'filesSection', 'uploadFile']) await plugin.call('filePanel', 'uploadFile', target)