From 0d2a515e51f92ddfbbf734aafb9265e5f79d2ab8 Mon Sep 17 00:00:00 2001 From: chenhang Date: Wed, 17 Jun 2026 14:35:28 +0800 Subject: [PATCH] fix(sidebar): redirect to splash screen after logout --- src/app/sidebar/sidebar-screen.tsx | 2 +- src/stores/auth/auth-actors.ts | 7 ------- 2 files changed, 1 insertion(+), 8 deletions(-) diff --git a/src/app/sidebar/sidebar-screen.tsx b/src/app/sidebar/sidebar-screen.tsx index 4b552507..b0eb898c 100644 --- a/src/app/sidebar/sidebar-screen.tsx +++ b/src/app/sidebar/sidebar-screen.tsx @@ -44,7 +44,7 @@ export function SidebarScreen() { const handleLogoutClick = () => { authDispatch({ type: "AuthReset" }); userDispatch({ type: "UserLogout" }); - router.replace(ROUTES.chat); + router.replace(ROUTES.splash); }; // 状态派生:未登录 / 已登录未 VIP / 已登录 VIP diff --git a/src/stores/auth/auth-actors.ts b/src/stores/auth/auth-actors.ts index efae0378..4a7fc050 100644 --- a/src/stores/auth/auth-actors.ts +++ b/src/stores/auth/auth-actors.ts @@ -1,12 +1,5 @@ /** * Auth 状态机:Actors(异步服务) - * - * 原始 Dart: lib/ui/auth/bloc/auth_bloc.dart + auth_state.dart + auth_event.dart - * - * 本轮迁移:所有认证登录调用(含 OAuth 社交登录)统一收口到状态机内。 - * 业务层只派发事件(`AuthEmailLoginSubmitted` / `AuthGoogleLoginSubmitted` / 等), - * 状态机通过 actors 调 `authRepository`(邮箱 / OAuth token sync)或 - * `next-auth/react.signIn`(OAuth 跳转)。 */ import { fromPromise } from "xstate";