save file with .yul extension if language is yul in URL

pull/2691/head^2
Aniket-Engg 2 years ago committed by Aniket
parent 2c2e64079b
commit 23aa4fbd6a
  1. 5
      libs/remix-ui/workspace/src/lib/actions/workspace.ts

@ -75,7 +75,8 @@ export const createWorkspaceTemplate = async (workspaceName: string, template: W
export type UrlParametersType = {
gist: string,
code: string,
url: string
url: string,
language: string
}
export const loadWorkspacePreset = async (template: WorkspaceTemplate = 'remixDefault') => {
@ -91,7 +92,7 @@ export const loadWorkspacePreset = async (template: WorkspaceTemplate = 'remixDe
if (params.code) {
const hash = bufferToHex(keccakFromString(params.code))
path = 'contract-' + hash.replace('0x', '').substring(0, 10) + '.sol'
path = 'contract-' + hash.replace('0x', '').substring(0, 10) + (params.language && params.language.toLowerCase() === 'yul' ? '.yul': '.sol')
content = atob(params.code)
await workspaceProvider.set(path, content)
}

Loading…
Cancel
Save