mirror of
https://github.com/pagefaultgames/pokerogue.git
synced 2025-09-24 15:33:29 +02:00
Only log session / system if beta or local; fix promise
This commit is contained in:
parent
8dd28d1cd0
commit
3ae69dcac9
@ -68,6 +68,7 @@ import { executeIf, fixedInt, isLocal, NumberHolder, randInt, randSeedItem } fro
|
|||||||
import { decrypt, encrypt } from "#utils/data";
|
import { decrypt, encrypt } from "#utils/data";
|
||||||
import { getEnumKeys } from "#utils/enums";
|
import { getEnumKeys } from "#utils/enums";
|
||||||
import { getPokemonSpecies } from "#utils/pokemon-utils";
|
import { getPokemonSpecies } from "#utils/pokemon-utils";
|
||||||
|
import { isBeta } from "#utils/utility-vars";
|
||||||
import { AES, enc } from "crypto-js";
|
import { AES, enc } from "crypto-js";
|
||||||
import i18next from "i18next";
|
import i18next from "i18next";
|
||||||
|
|
||||||
@ -422,7 +423,9 @@ export class GameData {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
console.debug(systemData);
|
if (isLocal || isBeta) {
|
||||||
|
console.debug(JSON.parse(JSON.stringify(systemData)));
|
||||||
|
}
|
||||||
|
|
||||||
localStorage.setItem(`data_${loggedInUser?.username}`, encrypt(systemDataStr, bypassLogin));
|
localStorage.setItem(`data_${loggedInUser?.username}`, encrypt(systemDataStr, bypassLogin));
|
||||||
|
|
||||||
@ -1038,7 +1041,9 @@ export class GameData {
|
|||||||
const { promise, resolve, reject } = Promise.withResolvers<boolean>();
|
const { promise, resolve, reject } = Promise.withResolvers<boolean>();
|
||||||
try {
|
try {
|
||||||
const initSessionFromData = (fromSession: SessionSaveData) => {
|
const initSessionFromData = (fromSession: SessionSaveData) => {
|
||||||
console.debug(fromSession);
|
if (isLocal || isBeta) {
|
||||||
|
console.debug(JSON.parse(JSON.stringify(fromSession)));
|
||||||
|
}
|
||||||
// overwrite slot ID if somehow not set.
|
// overwrite slot ID if somehow not set.
|
||||||
fromSession.slotId = slotId;
|
fromSession.slotId = slotId;
|
||||||
|
|
||||||
@ -1185,9 +1190,6 @@ export class GameData {
|
|||||||
} else {
|
} else {
|
||||||
this.getSession(slotId)
|
this.getSession(slotId)
|
||||||
.then(data => {
|
.then(data => {
|
||||||
if (data) {
|
|
||||||
initSessionFromData(data);
|
|
||||||
}
|
|
||||||
return data && initSessionFromData(data);
|
return data && initSessionFromData(data);
|
||||||
})
|
})
|
||||||
.catch(err => {
|
.catch(err => {
|
||||||
|
Loading…
Reference in New Issue
Block a user