Commit cd314569 authored by yann300's avatar yann300

use currentFile

parent 8e73be41
......@@ -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)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment