Settings: jump to sign in after signed out

This commit is contained in:
thislight 2024-12-23 18:16:52 +08:00
parent ee31c38f32
commit 3444068fd8
No known key found for this signature in database
GPG key ID: FCFE5192241CCD4E

View file

@ -163,7 +163,7 @@ const Settings: Component = () => {
}>,
() => import(`./i18n/generic.json`),
);
const { pop } = useNavigator();
const { pop, push } = useNavigator();
const settings$ = useStore($settings);
const { needRefresh } = useServiceWorker();
const dateFnLocale = useDateFnLocale();
@ -172,6 +172,10 @@ const Settings: Component = () => {
const doSignOut = (acct: Account) => {
signOut((a) => a.site === acct.site && a.accessToken === acct.accessToken);
if (profiles().length == 0) {
push("/accounts/sign-in", { replace: "all" });
}
};
css`