createing new file every time user clickes on start coding

pull/5370/head
lianahus 1 year ago
parent d5b2acd997
commit 9dd68b4d95
  1. 14
      libs/remix-ui/home-tab/src/lib/components/homeTabFile.tsx
  2. 2
      libs/remix-ws-templates/src/templates/playground/index.ts

@ -139,7 +139,19 @@ function HomeTabFile({ plugin }: HomeTabFileProps) {
}
await plugin.call('filePanel', 'switchToWorkspace', { name: wName, isLocalHost: false })
await plugin.call('filePanel', 'switchToWorkspace', { name: wName, isLocalHost: false }) // calling once is not working.
await plugin.call('fileManager', 'open', '/contracts/helloWorld.sol')
const content = `// SPDX-License-Identifier: MIT
pragma solidity >=0.6.12 <0.9.0;
contract HelloWorld {
function print() public pure returns (string memory) {
return "Hello World!";
}
}
`
const { newPath } = await plugin.call('fileManager', 'writeFileNoRewrite', '/contracts/helloWorld.sol', content)
await plugin.call('fileManager', 'open', newPath)
//await plugin.call('fileManager', 'open', '/contracts/helloWorld.sol')
}
const uploadFile = async (target) => {
_paq.push(['trackEvent', 'hometab', 'filesSection', 'uploadFile'])

@ -1,7 +1,7 @@
export default async () => {
return {
// @ts-ignore
'contracts/helloWorld.sol': (await import('raw-loader!./contracts/helloWorld.sol')).default,
//'contracts/helloWorld.sol': (await import('raw-loader!./contracts/helloWorld.sol')).default,
// @ts-ignore
'scripts/deploy_with_ethers.ts': (await import('!!raw-loader!./scripts/deploy_with_ethers.ts')).default,
// @ts-ignore

Loading…
Cancel
Save