chore: enable WoT for existing sessions

This commit is contained in:
kieran 2024-09-18 13:12:23 +01:00
parent f8f1b70787
commit b26eb5007f
No known key found for this signature in database
GPG Key ID: DE71CEB3925BE941

View File

@ -17,7 +17,7 @@ import { v4 as uuid } from "uuid";
import { createPublisher, LoginSession, LoginSessionType, SnortAppData } from "@/Utils/Login/index"; import { createPublisher, LoginSession, LoginSessionType, SnortAppData } from "@/Utils/Login/index";
import { DefaultPreferences } from "./Preferences"; import { DefaultPreferences, UserPreferences } from "./Preferences";
const AccountStoreKey = "sessions"; const AccountStoreKey = "sessions";
const LoggedOut = { const LoggedOut = {
@ -359,6 +359,13 @@ export class MultiAccountStore extends ExternalStore<LoginSession> {
delete acc.state.appdata["showContentWarningPosts"]; delete acc.state.appdata["showContentWarningPosts"];
didMigrate = true; didMigrate = true;
} }
if (acc.state.appdata.preferences) {
if (!("muteWithWoT" in acc.state.appdata.preferences)) {
(acc.state.appdata.preferences as UserPreferences)["muteWithWoT"] = true;
didMigrate = true;
}
}
} }
} }