fix: 🐛 Have showSuspendedDialog properly defined in account.ts

This commit is contained in:
ThatOneCalculator 2023-09-27 11:16:58 -07:00 committed by Kainoa Kanter
parent 26bc90e44b
commit 05097ac608

View File

@ -97,9 +97,9 @@ function fetchAccount(token: string): Promise<Account> {
.then((res) => { .then((res) => {
if (res.error) { if (res.error) {
if (res.error.id === "a8c724b3-6e9c-4b46-b1a8-bc3ed6258370") { if (res.error.id === "a8c724b3-6e9c-4b46-b1a8-bc3ed6258370") {
showSuspendedDialog().then(() => { showSuspendedDialog();
signout(); signout();
}); return;
} else { } else {
alert({ alert({
type: "error", type: "error",
@ -116,6 +116,14 @@ function fetchAccount(token: string): Promise<Account> {
}); });
} }
function showSuspendedDialog() {
alert({
type: "error",
title: i18n.ts.yourAccountSuspendedTitle,
text: i18n.ts.yourAccountSuspendedDescription,
});
}
export function updateAccount(accountData) { export function updateAccount(accountData) {
for (const [key, value] of Object.entries(accountData)) { for (const [key, value] of Object.entries(accountData)) {
$i[key] = value; $i[key] = value;