remove writing files to explorer as per @bunsentraat's recommendations

pull/5370/head
Joseph Izang 2 years ago committed by Aniket
parent b0ac1c22ec
commit 1dd19f32e5
  1. 12
      apps/remix-ide/src/app/files/fileManager.ts
  2. 4
      apps/remix-ide/src/app/plugins/solidity-umlgen.tsx

@ -631,12 +631,12 @@ class FileManager extends Plugin {
let content = ''
try {
content = await provider.get(file)
if (file.split('.')[1].includes('svg')) {
if (!await this.appManager.isActive('solidityumlgen')) await this.appManager.activatePlugin('solidityumlgen')
provider.isReadOnly(file)
this.call('solidityumlgen', 'showUmlDiagram', content)
return
}
// if (file.split('.')[1].includes('svg')) {
// if (!await this.appManager.isActive('solidityumlgen')) await this.appManager.activatePlugin('solidityumlgen')
// provider.isReadOnly(file)
// this.call('solidityumlgen', 'showUmlDiagram', content)
// return
// }
} catch (error) {
console.log(error)
throw error

@ -50,8 +50,8 @@ export class SolidityUmlGen extends ViewPlugin implements ISolidityUmlGen {
}
const ast = result.length > 1 ? parser.parse(result) : parser.parse(source.sources[this.currentFile].content)
const payload = vizRenderStringSync(convertUmlClasses2Dot(convertAST2UmlClasses(ast, this.currentFile)))
const fileName = `${this.currentFile.split('/')[0]}/resources/${this.currentFile.split('/')[1].split('.')[0]}.svg`
await this.call('fileManager', 'writeFile', fileName, payload)
// const fileName = `${this.currentFile.split('/')[0]}/resources/${this.currentFile.split('/')[1].split('.')[0]}.svg`
// await this.call('fileManager', 'writeFile', fileName, payload)
this.updatedSvg = payload
this.renderComponent()
} catch (error) {

Loading…
Cancel
Save