1
0
mirror of https://github.com/sehugg/8bitworkshop.git synced 2024-11-25 18:33:11 +00:00

alert when file not found, except for Create New File

This commit is contained in:
Steven Hugg 2019-08-27 19:32:44 -04:00
parent c655628f37
commit ceea8f292b
2 changed files with 8 additions and 2 deletions

View File

@ -163,6 +163,7 @@ TODO:
- make sure to flatten subdirs
- re-publish repo (bug: doesn't put all files in local repo after publishing)
- allow text/binary change
- importing from subtree commits to root anyway
- astrocade
- keyboard shortcuts
- ctrl+alt+l on ubuntu locks screen

View File

@ -289,11 +289,15 @@ function loadProject(preset_id:string) {
// file found; continue
loadMainWindow(preset_id);
} else {
// no file data, load skeleton file
getSkeletonFile(preset_id).then((skel) => {
current_project.filedata[preset_id] = skel || "\n";
loadMainWindow(preset_id);
//alertInfo("No existing file found; loading default file");
// don't alert if we selected "new file"
if (!qs['newfile']) {
alertInfo("Could not find file \"" + preset_id + "\". Loading default file.");
}
delete qs['newfile'];
replaceURLState();
});
}
});
@ -343,6 +347,7 @@ function _createNewFile(e) {
}
var path = filename;
gaEvent('workspace', 'file', 'new');
qs['newfile'] = '1';
reloadProject(path);
}
}