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 = '' let content = ''
try { try {
content = await provider.get(file) content = await provider.get(file)
if (file.split('.')[1].includes('svg')) { // if (file.split('.')[1].includes('svg')) {
if (!await this.appManager.isActive('solidityumlgen')) await this.appManager.activatePlugin('solidityumlgen') // if (!await this.appManager.isActive('solidityumlgen')) await this.appManager.activatePlugin('solidityumlgen')
provider.isReadOnly(file) // provider.isReadOnly(file)
this.call('solidityumlgen', 'showUmlDiagram', content) // this.call('solidityumlgen', 'showUmlDiagram', content)
return // return
} // }
} catch (error) { } catch (error) {
console.log(error) console.log(error)
throw 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 ast = result.length > 1 ? parser.parse(result) : parser.parse(source.sources[this.currentFile].content)
const payload = vizRenderStringSync(convertUmlClasses2Dot(convertAST2UmlClasses(ast, this.currentFile))) const payload = vizRenderStringSync(convertUmlClasses2Dot(convertAST2UmlClasses(ast, this.currentFile)))
const fileName = `${this.currentFile.split('/')[0]}/resources/${this.currentFile.split('/')[1].split('.')[0]}.svg` // const fileName = `${this.currentFile.split('/')[0]}/resources/${this.currentFile.split('/')[1].split('.')[0]}.svg`
await this.call('fileManager', 'writeFile', fileName, payload) // await this.call('fileManager', 'writeFile', fileName, payload)
this.updatedSvg = payload this.updatedSvg = payload
this.renderComponent() this.renderComponent()
} catch (error) { } catch (error) {

Loading…
Cancel
Save