mirror of
https://github.com/pagefaultgames/pokerogue.git
synced 2025-09-23 06:53:27 +02:00
Reverted title phase async change
This commit is contained in:
parent
c41a98447a
commit
ba489231f9
@ -173,23 +173,21 @@ export class TitlePhase extends Phase {
|
||||
globalScene.sessionSlotId = slotId > -1 || !loggedInUser ? slotId : loggedInUser.lastSessionSlot;
|
||||
globalScene.ui.setMode(UiMode.MESSAGE);
|
||||
globalScene.ui.resetModeChain();
|
||||
globalScene.gameData
|
||||
.loadSession(slotId, slotId === -1 ? this.lastSessionData : undefined)
|
||||
.then((success: boolean) => {
|
||||
if (success) {
|
||||
this.loaded = true;
|
||||
if (loggedInUser) {
|
||||
loggedInUser.lastSessionSlot = slotId;
|
||||
}
|
||||
globalScene.ui.showText(i18next.t("menu:sessionSuccess"), null, () => this.end());
|
||||
} else {
|
||||
this.end();
|
||||
try {
|
||||
const success = await globalScene.gameData.loadSession(slotId, slotId === -1 ? this.lastSessionData : undefined);
|
||||
if (success) {
|
||||
this.loaded = true;
|
||||
if (loggedInUser) {
|
||||
loggedInUser.lastSessionSlot = slotId;
|
||||
}
|
||||
})
|
||||
.catch(err => {
|
||||
console.error(err);
|
||||
globalScene.ui.showText(i18next.t("menu:failedToLoadSession"), null);
|
||||
});
|
||||
globalScene.ui.showText(i18next.t("menu:sessionSuccess"), null, () => this.end());
|
||||
} else {
|
||||
this.end();
|
||||
}
|
||||
} catch (err) {
|
||||
console.error(err);
|
||||
globalScene.ui.showText(i18next.t("menu:failedToLoadSession"), null);
|
||||
}
|
||||
}
|
||||
|
||||
initDailyRun(): void {
|
||||
|
Loading…
Reference in New Issue
Block a user