fix(core): fix app boot speed (#5885)

This commit is contained in:
EYHN 2024-02-23 07:07:03 +00:00
parent 7ec3f7a042
commit 3f7f78c8f4
No known key found for this signature in database
GPG Key ID: 46C9E26A75AB276C
2 changed files with 5 additions and 4 deletions

View File

@ -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);

View File

@ -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) {