mirror of
https://github.com/pagefaultgames/pokerogue.git
synced 2025-07-29 19:52:27 +02:00
[Bug] Fixing continue error when game finishes
This commit is contained in:
parent
009fd3fc5c
commit
fb30fe8f7e
@ -1174,6 +1174,9 @@ export class GameData {
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Attempt to clear session data. After session data is removed, attempt to update user info so the menu updates
|
||||||
|
*/
|
||||||
tryClearSession(scene: BattleScene, slotId: integer): Promise<[success: boolean, newClear: boolean]> {
|
tryClearSession(scene: BattleScene, slotId: integer): Promise<[success: boolean, newClear: boolean]> {
|
||||||
return new Promise<[boolean, boolean]>(resolve => {
|
return new Promise<[boolean, boolean]>(resolve => {
|
||||||
if (bypassLogin) {
|
if (bypassLogin) {
|
||||||
@ -1181,10 +1184,6 @@ export class GameData {
|
|||||||
return resolve([true, true]);
|
return resolve([true, true]);
|
||||||
}
|
}
|
||||||
|
|
||||||
updateUserInfo().then(success => {
|
|
||||||
if (success !== null && !success) {
|
|
||||||
return resolve([false, false]);
|
|
||||||
}
|
|
||||||
const sessionData = this.getSessionSaveData(scene);
|
const sessionData = this.getSessionSaveData(scene);
|
||||||
Utils.apiPost(`savedata/session/clear?slot=${slotId}&trainerId=${this.trainerId}&secretId=${this.secretId}&clientSessionId=${clientSessionId}`, JSON.stringify(sessionData), undefined, true).then(response => {
|
Utils.apiPost(`savedata/session/clear?slot=${slotId}&trainerId=${this.trainerId}&secretId=${this.secretId}&clientSessionId=${clientSessionId}`, JSON.stringify(sessionData), undefined, true).then(response => {
|
||||||
if (response.ok) {
|
if (response.ok) {
|
||||||
@ -1203,7 +1202,15 @@ export class GameData {
|
|||||||
console.error(jsonResponse);
|
console.error(jsonResponse);
|
||||||
resolve([false, false]);
|
resolve([false, false]);
|
||||||
});
|
});
|
||||||
|
}).then(result => {
|
||||||
|
updateUserInfo().then(success => {
|
||||||
|
if (success !== null && !success) {
|
||||||
|
return new Promise<[boolean, boolean]>(resolve => {
|
||||||
|
return resolve([false, false]);
|
||||||
});
|
});
|
||||||
|
}
|
||||||
|
});
|
||||||
|
return result;
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user