diff --git a/frontend/src/ts/controllers/verification-controller.ts b/frontend/src/ts/controllers/verification-controller.ts index a6b013ada..178169ea7 100644 --- a/frontend/src/ts/controllers/verification-controller.ts +++ b/frontend/src/ts/controllers/verification-controller.ts @@ -3,6 +3,7 @@ import * as Notifications from "../elements/notifications"; import * as Settings from "../pages/settings"; import * as DB from "../db"; import * as Loader from "../elements/loader"; +import * as AccountButton from "../elements/account-button"; interface Data { accessToken: string; @@ -41,5 +42,7 @@ export async function verify(): Promise { DB.setSnapshot(snapshot); + AccountButton.update(discordId, discordAvatar); + Settings.updateDiscordSection(); } diff --git a/frontend/src/ts/popups/simple-popups.ts b/frontend/src/ts/popups/simple-popups.ts index 0476f97f4..793be377c 100644 --- a/frontend/src/ts/popups/simple-popups.ts +++ b/frontend/src/ts/popups/simple-popups.ts @@ -10,6 +10,7 @@ import * as ThemePicker from "../settings/theme-picker"; import * as CustomText from "../test/custom-text"; import * as CustomTextPopup from "../popups/custom-text-popup"; import * as SavedTextsPopup from "./saved-texts-popup"; +import * as AccountButton from "../elements/account-button"; import { FirebaseError } from "firebase/app"; import { Auth } from "../firebase"; import { @@ -857,7 +858,11 @@ list["unlinkDiscord"] = new SimplePopup( } Notifications.add("Accounts unlinked", 1); - DB.getSnapshot().discordId = undefined; + const snap = DB.getSnapshot(); + snap.discordAvatar = undefined; + snap.discordId = undefined; + AccountButton.update(); + DB.setSnapshot(snap); Settings.updateDiscordSection(); }, () => {