mirror of
https://github.com/toeverything/AFFiNE.git
synced 2024-11-26 15:03:34 +03:00
fix(core): fix app boot speed (#5885)
This commit is contained in:
parent
7ec3f7a042
commit
3f7f78c8f4
@ -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);
|
||||
|
||||
|
@ -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) {
|
||||
|
Loading…
Reference in New Issue
Block a user