From 3f9f4cd73be4cdc71b7b5bc7682b15e3a46220d1 Mon Sep 17 00:00:00 2001 From: yann300 Date: Wed, 8 Sep 2021 21:36:06 +0200 Subject: [PATCH] use currentFile --- .../solidity-compiler/src/lib/compiler-container.tsx | 6 +++--- .../solidity-compiler/src/lib/logic/compileTabLogic.ts | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/libs/remix-ui/solidity-compiler/src/lib/compiler-container.tsx b/libs/remix-ui/solidity-compiler/src/lib/compiler-container.tsx index 72c997b39f..21d2d7d5cf 100644 --- a/libs/remix-ui/solidity-compiler/src/lib/compiler-container.tsx +++ b/libs/remix-ui/solidity-compiler/src/lib/compiler-container.tsx @@ -57,7 +57,7 @@ export const CompilerContainer = (props: CompilerContainerProps) => { _updateVersionSelector(selectedVersion) } }) - const currentFileName = api.getAppParameter('currentFile') as string + const currentFileName = api.currentFile currentFile(currentFileName) listenToEvents(compileTabLogic, api)(dispatch) @@ -229,7 +229,7 @@ export const CompilerContainer = (props: CompilerContainerProps) => { } const isSolFileSelected = (currentFile: string = '') => { - if (!currentFile) currentFile = api.getAppParameter('currentFile') as string + if (!currentFile) currentFile = api.currentFile if (!currentFile) return false const extention = currentFile.substr(currentFile.length - 3, currentFile.length) return extention.toLowerCase() === 'sol' || extention.toLowerCase() === 'yul' @@ -298,7 +298,7 @@ export const CompilerContainer = (props: CompilerContainerProps) => { } const compile = () => { - const currentFile = api.getAppParameter('currentFile') as string + const currentFile = api.currentFile if (!isSolFileSelected()) return diff --git a/libs/remix-ui/solidity-compiler/src/lib/logic/compileTabLogic.ts b/libs/remix-ui/solidity-compiler/src/lib/logic/compileTabLogic.ts index 69861c12a1..7d036edf12 100644 --- a/libs/remix-ui/solidity-compiler/src/lib/logic/compileTabLogic.ts +++ b/libs/remix-ui/solidity-compiler/src/lib/logic/compileTabLogic.ts @@ -123,7 +123,7 @@ export class CompileTabLogic { // TODO readd saving current file this.api.saveCurrentFile() this.event.emit('removeAnnotations') - var currentFile = this.api.getAppParameter('currentFile') + var currentFile = this.api.currentFile return this.compileFile(currentFile) } catch (err) { console.error(err)