From 3f7f78c8f4f83722e62cd0882d97404b7e0a54fc Mon Sep 17 00:00:00 2001 From: EYHN Date: Fri, 23 Feb 2024 07:07:03 +0000 Subject: [PATCH] fix(core): fix app boot speed (#5885) --- packages/frontend/core/src/pages/index.tsx | 5 ++--- packages/frontend/core/src/providers/modal-provider.tsx | 4 +++- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/packages/frontend/core/src/pages/index.tsx b/packages/frontend/core/src/pages/index.tsx index 98efe6e0af..4865f73964 100644 --- a/packages/frontend/core/src/pages/index.tsx +++ b/packages/frontend/core/src/pages/index.tsx @@ -32,12 +32,11 @@ export const Component = () => { const [creating, setCreating] = useState(false); const list = useLiveData(useService(WorkspaceListService).workspaceList); - const workspaceStatus = useLiveData(useService(WorkspaceListService).status); const { openPage } = useNavigateHelper(); useLayoutEffect(() => { - if (list.length === 0 || workspaceStatus.loading) { + if (list.length === 0) { return; } @@ -47,7 +46,7 @@ export const Component = () => { const openWorkspace = list.find(w => w.id === lastId) ?? list[0]; openPage(openWorkspace.id, WorkspaceSubPath.ALL); setNavigating(true); - }, [list, workspaceStatus, openPage]); + }, [list, openPage]); const workspaceManager = useService(WorkspaceManager); diff --git a/packages/frontend/core/src/providers/modal-provider.tsx b/packages/frontend/core/src/providers/modal-provider.tsx index 41ed373658..a1922eae86 100644 --- a/packages/frontend/core/src/providers/modal-provider.tsx +++ b/packages/frontend/core/src/providers/modal-provider.tsx @@ -216,7 +216,9 @@ export const SignOutConfirmModal = () => { const onConfirm = useAsyncCallback(async () => { setOpen(false); - await signOutCloud(); + await signOutCloud({ + redirect: false, + }); // if current workspace is affine cloud, switch to local workspace if (currentWorkspace?.flavour === WorkspaceFlavour.AFFINE_CLOUD) {