Cat in front of keyboar d sorry

This commit is contained in:
frutescens 2024-11-09 14:23:24 -08:00
parent ae89cb7fdc
commit f649295cf0
3 changed files with 9 additions and 13 deletions

View File

@ -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 {

View File

@ -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);
});
}
}

View File

@ -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 () => {