Added ability to track profile migrations in profile

Stored when 39x profiles are migrated
This commit is contained in:
Dev 2024-09-21 10:51:52 +01:00
parent 0fa22f0349
commit acb6762181
2 changed files with 10 additions and 1 deletions

View File

@ -159,9 +159,16 @@ export class GameController {
return; return;
} }
if (typeof fullProfile.spt.migrations === "undefined") {
fullProfile.spt.migrations = {};
}
//3.9 migrations //3.9 migrations
if (fullProfile.spt.version.includes("3.9")) { if (fullProfile.spt.version.includes("3.9.") && !fullProfile.spt.migrations["39x"]) {
this.migrate39xProfile(fullProfile); this.migrate39xProfile(fullProfile);
// Flag as migrated
fullProfile.spt.migrations["39x"] = this.timeUtil.getTimestamp();
} }
if (Array.isArray(fullProfile.characters.pmc.WishList)) { if (Array.isArray(fullProfile.characters.pmc.WishList)) {

View File

@ -195,6 +195,8 @@ export interface Spt {
blacklistedItemTpls?: string[]; blacklistedItemTpls?: string[];
/** key: daily type */ /** key: daily type */
freeRepeatableRefreshUsedCount?: Record<string, number>; freeRepeatableRefreshUsedCount?: Record<string, number>;
/** When was a profile migrated, value is timestamp */
migrations?: Record<string, number>;
} }
export interface ModDetails { export interface ModDetails {