use currentFile

pull/5370/head
yann300 3 years ago committed by davidzagi93@gmail.com
parent 822e67a076
commit 3f5729b49a
  1. 6
      libs/remix-ui/solidity-compiler/src/lib/compiler-container.tsx
  2. 2
      libs/remix-ui/solidity-compiler/src/lib/logic/compileTabLogic.ts

@ -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

@ -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)

Loading…
Cancel
Save