Properly reset data when logging out to avoid data leakage
parent
3e5a0d5c9c
commit
15e3fefd80
|
@ -591,7 +591,10 @@ export default class BattleScene extends SceneBase {
|
|||
return this.currentBattle.randSeedInt(this, range, min);
|
||||
}
|
||||
|
||||
reset(clearScene?: boolean): void {
|
||||
reset(clearScene: boolean = false, clearData: boolean = false): void {
|
||||
if (clearData)
|
||||
this.gameData = new GameData(this);
|
||||
|
||||
this.gameMode = gameModes[GameModes.CLASSIC];
|
||||
|
||||
this.setSeed(SEED_OVERRIDE || Utils.randomString(24));
|
||||
|
|
|
@ -284,7 +284,7 @@ export default class MenuUiHandler extends MessageUiHandler {
|
|||
if (!res.ok)
|
||||
console.error(`Log out failed (${res.status}: ${res.statusText})`);
|
||||
Utils.setCookie(Utils.sessionIdKey, '');
|
||||
updateUserInfo().then(() => this.scene.reset(true));
|
||||
updateUserInfo().then(() => this.scene.reset(true, true));
|
||||
});
|
||||
};
|
||||
if (this.scene.currentBattle) {
|
||||
|
|
Loading…
Reference in New Issue