pull/1647/head
filip mertens 3 years ago
parent fbe86095ea
commit 1b162219eb
  1. 30
      apps/remix-ide/src/app/files/fileManager.js

@ -749,23 +749,19 @@ class FileManager extends Plugin {
}) })
await self.syncEditor(fileProvider + file) await self.syncEditor(fileProvider + file)
} else { } else {
helper.createNonClashingName(file, self._deps.filesProviders[fileProvider], try {
async (error, name) => { const name = await helper.createNonClashingNameAsync(file, self)
if (error) { if (helper.checkSpecialChars(name)) {
modalDialogCustom.alert('Unexpected error loading the file ' + error) modalDialogCustom.alert('Special characters are not allowed')
} else if (helper.checkSpecialChars(name)) { } else {
modalDialogCustom.alert('Special characters are not allowed') await self._deps.filesProviders[fileProvider].set(name, filesSet[file].content)
} else { await self.syncEditor(fileProvider + name)
try { }
console.log('set ', fileProvider, name, filesSet[file].content) } catch (error) {
await self._deps.filesProviders[fileProvider].set(name, filesSet[file].content) modalDialogCustom.alert('Unexpected error loading the file ' + error)
} catch (e) { return callback(error.message || error)
return callback(e.message || e) }
} callback()
await self.syncEditor(fileProvider + name)
}
callback()
})
} }
} }
} }

Loading…
Cancel
Save