fix run scenario from remixd

pull/1/head
yann300 7 years ago
parent d50dcc4b25
commit 03f55cc564
  1. 7
      src/app/tabs/run-tab.js

@ -327,7 +327,10 @@ function makeRecorder (events, appAPI, appEvents) {
} }
runButton.onclick = () => { runButton.onclick = () => {
var currentFile = appAPI.config.get('currentFile') var currentFile = appAPI.config.get('currentFile')
var json = appAPI.filesProviders['browser'].get(currentFile) appAPI.fileProviderOf(currentFile).get(currentFile, (error, json) => {
if (error) {
modalDialogCustom.alert('Invalid Scenario File ' + error)
} else {
if (currentFile.match('.json$')) { if (currentFile.match('.json$')) {
try { try {
var obj = JSON.parse(json) var obj = JSON.parse(json)
@ -349,6 +352,8 @@ function makeRecorder (events, appAPI, appEvents) {
modalDialogCustom.alert('A Scenario File is required. The file must be of type JSON. Use the "Save Transactions" Button to generate a new Scenario File.') modalDialogCustom.alert('A Scenario File is required. The file must be of type JSON. Use the "Save Transactions" Button to generate a new Scenario File.')
} }
} }
})
}
return { recordButton, runButton } return { recordButton, runButton }
} }
/* ------------------------------------------------ /* ------------------------------------------------

Loading…
Cancel
Save