From 3444068fd81a4ce541a6388f2c0e45a64c0a2fca Mon Sep 17 00:00:00 2001 From: thislight Date: Mon, 23 Dec 2024 18:16:52 +0800 Subject: [PATCH] Settings: jump to sign in after signed out --- src/settings/Settings.tsx | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/settings/Settings.tsx b/src/settings/Settings.tsx index 188a61d..f783e7a 100644 --- a/src/settings/Settings.tsx +++ b/src/settings/Settings.tsx @@ -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`