fix: log into next stored account on logout

This commit is contained in:
trisua 2025-05-10 22:40:32 -04:00
parent 8e241b3435
commit ba1f8ef063

View file

@ -24,14 +24,20 @@
res.message, res.message,
]); ]);
if (res.ok) {
delete self.LOGIN_ACCOUNT_TOKENS[res.payload]; delete self.LOGIN_ACCOUNT_TOKENS[res.payload];
self.set_login_account_tokens(self.LOGIN_ACCOUNT_TOKENS); self.set_login_account_tokens(self.LOGIN_ACCOUNT_TOKENS);
if (res.ok) { const next = Object.entries(self.LOGIN_ACCOUNT_TOKENS)[0];
if (next) {
self.login(next[0]);
} else {
setTimeout(() => { setTimeout(() => {
window.location.href = "/"; window.location.href = "/";
}, 150); }, 150);
} }
}
}); });
}); });