From f649295cf093d5192c67d36cbfaada2f2d151d6b Mon Sep 17 00:00:00 2001 From: frutescens Date: Sat, 9 Nov 2024 14:23:24 -0800 Subject: [PATCH] Cat in front of keyboar d sorry --- src/@types/PokerogueSessionSavedataApi.ts | 2 +- src/phases/game-over-phase.ts | 16 ++++++---------- .../api/pokerogue-session-savedata-api.test.ts | 4 ++-- 3 files changed, 9 insertions(+), 13 deletions(-) diff --git a/src/@types/PokerogueSessionSavedataApi.ts b/src/@types/PokerogueSessionSavedataApi.ts index 094e035f456..5dbe6910b26 100644 --- a/src/@types/PokerogueSessionSavedataApi.ts +++ b/src/@types/PokerogueSessionSavedataApi.ts @@ -8,8 +8,8 @@ export class UpdateSessionSavedataRequest { /** This is **NOT** similar to {@linkcode ClearSessionSavedataRequest} */ export interface NewClearSessionSavedataRequest { slot: number; - clientSessionId: string; result: boolean; + clientSessionId: string; } export interface GetSessionSavedataRequest { diff --git a/src/phases/game-over-phase.ts b/src/phases/game-over-phase.ts index c571fdbbeb9..eb97c7437a7 100644 --- a/src/phases/game-over-phase.ts +++ b/src/phases/game-over-phase.ts @@ -176,17 +176,13 @@ export class GameOverPhase extends BattlePhase { /* Added a local check to see if the game is running offline on victory If Online, execute apiFetch as intended If Offline, execute offlineNewClear(), a localStorage implementation of newClear daily run checks */ - if (this.victory) { - if (!Utils.isLocal || Utils.isLocalServerConnected) { - pokerogueApi.savedata.session.newclear({ slot: this.scene.sessionSlotId, clientSessionId, result: this.victory }) - .then((success) => doGameOver(!!success)); - } else { - this.scene.gameData.offlineNewClear(this.scene).then(result => { - doGameOver(result); - }); - } + if (!Utils.isLocal || Utils.isLocalServerConnected) { + pokerogueApi.savedata.session.newclear({ slot: this.scene.sessionSlotId, result: this.victory, clientSessionId: clientSessionId }) + .then((success) => doGameOver(!!success)); } else { - doGameOver(false); + this.scene.gameData.offlineNewClear(this.scene).then(result => { + doGameOver(result); + }); } } diff --git a/src/test/plugins/api/pokerogue-session-savedata-api.test.ts b/src/test/plugins/api/pokerogue-session-savedata-api.test.ts index 9fd5e766ac4..6e34bfdf071 100644 --- a/src/test/plugins/api/pokerogue-session-savedata-api.test.ts +++ b/src/test/plugins/api/pokerogue-session-savedata-api.test.ts @@ -28,8 +28,8 @@ describe("Pokerogue Session Savedata API", () => { describe("Newclear", () => { const params: NewClearSessionSavedataRequest = { clientSessionId: "test-session-id", - slot: 3, - result: true + result: true, + slot: 3 }; it("should return true on SUCCESS", async () => {