fix createNewFile

pull/3094/head
yann300 7 years ago
parent 015fdb3a3b
commit 842f7f2d2f
  1. 4
      src/app/panels/file-panel.js

@ -224,12 +224,12 @@ function filepanel (appAPI, filesProvider) {
function createNewFile () {
modalDialogCustom.prompt(null, 'File Name', 'Untitled.sol', (input) => {
filesProvider['browser'].type + '/' + helper.createNonClashingName(input, filesProvider['browser'], (error, newName) => {
helper.createNonClashingName(input, filesProvider['browser'], (error, newName) => {
if (error) return modalDialogCustom.alert('Failed to create file ' + newName + ' ' + error)
if (!filesProvider['browser'].set(newName, '')) {
modalDialogCustom.alert('Failed to create file ' + newName)
} else {
appAPI.switchFile(newName)
appAPI.switchFile(filesProvider['browser'].type + '/' + newName)
}
})
})

Loading…
Cancel
Save