Merge pull request #4543 from Sindri-Labs/ews-preserve-whitespace-when-opening-json-files

Preserve whitespace when loading a JSON file through a `url` querystring parameter
pull/4556/head
yann300 9 months ago committed by GitHub
commit 51a2ff5daa
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
  1. 4
      libs/remix-ui/workspace/src/lib/actions/workspace.ts

@ -298,7 +298,9 @@ export const loadWorkspacePreset = async (template: WorkspaceTemplate = 'remixDe
}
return Object.keys(standardInput.sources)[0]
} else {
await workspaceProvider.set(path, JSON.stringify(content))
// preserve JSON whitepsace if this isn't a Solidity compiler JSON-input-output file
content = data.content
await workspaceProvider.set(path, content)
}
} catch (e) {
console.log(e)

Loading…
Cancel
Save