mirror of
https://github.com/tobspr/shapez.io.git
synced 2025-12-09 16:21:51 +00:00
Fix unhandled savegame error not being displayed
Move the file loading code into the try/catch block, as it can and will produce errors eventually.
This commit is contained in:
parent
2b890466b0
commit
3abfa9c35d
@ -138,14 +138,14 @@ export class MainMenuState extends GameState {
|
||||
const closeLoader = this.dialogs.showLoadingDialog();
|
||||
await waitNextFrame();
|
||||
|
||||
const data = await this.app.storage.requestOpenFile("bin");
|
||||
if (data === undefined) {
|
||||
// User canceled the request
|
||||
closeLoader();
|
||||
return;
|
||||
}
|
||||
|
||||
try {
|
||||
const data = await this.app.storage.requestOpenFile("bin");
|
||||
if (data === undefined) {
|
||||
// User canceled the request
|
||||
closeLoader();
|
||||
return;
|
||||
}
|
||||
|
||||
this.app.savegameMgr.importSavegame(data);
|
||||
closeLoader();
|
||||
this.dialogs.showWarning(
|
||||
|
||||
Loading…
Reference in New Issue
Block a user