diff --git a/apps/remix-ide/src/app/panels/file-panel.js b/apps/remix-ide/src/app/panels/file-panel.js index 528f291e37..b90fb73760 100644 --- a/apps/remix-ide/src/app/panels/file-panel.js +++ b/apps/remix-ide/src/app/panels/file-panel.js @@ -165,7 +165,7 @@ module.exports = class Filepanel extends ViewPlugin { saveRecent (workspace) { if (!localStorage.getItem('recentWorkspaces')) { - localStorage.setItem('recentWorkspaces', JSON.stringify('"first": "", "second": "", "third": ""')) + localStorage.setItem('recentWorkspaces', JSON.stringify(workspace)) } else { const recents = JSON.parse(localStorage.getItem('recentWorkspaces')) if (recents.first !== workspace.name && recents.second !== workspace.name && recents.third !== workspace.name) { 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 d9419174fc..55d8223886 100644 --- a/libs/remix-ui/home-tab/src/lib/components/homeTabFile.tsx +++ b/libs/remix-ui/home-tab/src/lib/components/homeTabFile.tsx @@ -115,21 +115,22 @@ function HomeTabFile({plugin}: HomeTabFileProps) { _paq.push(['trackEvent', 'hometab', 'filesSection', 'startCoding']) plugin.verticalIcons.select('filePanel') - const wName = 'Coding playground' + const wName = 'Playground' 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 { +} +` - contract helloWorld { - } - ` const {newContent, newPath} = await plugin.call('fileManager', 'writeFileNoRewrite', '/contracts/helloWorld.sol', content) await plugin.call('fileManager', 'open', newPath) } @@ -173,7 +174,20 @@ function HomeTabFile({plugin}: HomeTabFileProps) { const handleSwichToRecentWorkspace = async (e, workspaceName) => { e.preventDefault(); +<<<<<<< HEAD + await plugin.call('filePanel', 'switchToWorkspace', { name: workspaceName, isLocalhost: false }) +======= +<<<<<<< HEAD +<<<<<<< HEAD + await plugin.call('filePanel', 'switchToWorkspace', { name: workspaceName, isLocalhost: false }) + console.log('The link was clicked.'); +======= + await plugin.call('filePanel', 'switchToWorkspace', { name: workspaceName, isLocalhost: false }) +>>>>>>> e9b2848c5... cleanup fix undefined workspaces. Creating default Workspace +======= await plugin.call('filePanel', 'switchToWorkspace', { name: workspaceName, isLocalhost: false }) +>>>>>>> 06483cab7... fix vreating workspace +>>>>>>> 1b238a875... fix vreating workspace } const examples = state.modalInfo.examples.map((urlEl, key) => ( @@ -255,7 +269,6 @@ function HomeTabFile({plugin}: HomeTabFileProps) { /> -