mirror of
https://github.com/toeverything/AFFiNE.git
synced 2026-02-12 04:18:54 +00:00
fix(core): fix app boot speed (#5885)
This commit is contained in:
@@ -32,12 +32,11 @@ export const Component = () => {
|
|||||||
const [creating, setCreating] = useState(false);
|
const [creating, setCreating] = useState(false);
|
||||||
|
|
||||||
const list = useLiveData(useService(WorkspaceListService).workspaceList);
|
const list = useLiveData(useService(WorkspaceListService).workspaceList);
|
||||||
const workspaceStatus = useLiveData(useService(WorkspaceListService).status);
|
|
||||||
|
|
||||||
const { openPage } = useNavigateHelper();
|
const { openPage } = useNavigateHelper();
|
||||||
|
|
||||||
useLayoutEffect(() => {
|
useLayoutEffect(() => {
|
||||||
if (list.length === 0 || workspaceStatus.loading) {
|
if (list.length === 0) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -47,7 +46,7 @@ export const Component = () => {
|
|||||||
const openWorkspace = list.find(w => w.id === lastId) ?? list[0];
|
const openWorkspace = list.find(w => w.id === lastId) ?? list[0];
|
||||||
openPage(openWorkspace.id, WorkspaceSubPath.ALL);
|
openPage(openWorkspace.id, WorkspaceSubPath.ALL);
|
||||||
setNavigating(true);
|
setNavigating(true);
|
||||||
}, [list, workspaceStatus, openPage]);
|
}, [list, openPage]);
|
||||||
|
|
||||||
const workspaceManager = useService(WorkspaceManager);
|
const workspaceManager = useService(WorkspaceManager);
|
||||||
|
|
||||||
|
|||||||
@@ -216,7 +216,9 @@ export const SignOutConfirmModal = () => {
|
|||||||
|
|
||||||
const onConfirm = useAsyncCallback(async () => {
|
const onConfirm = useAsyncCallback(async () => {
|
||||||
setOpen(false);
|
setOpen(false);
|
||||||
await signOutCloud();
|
await signOutCloud({
|
||||||
|
redirect: false,
|
||||||
|
});
|
||||||
|
|
||||||
// if current workspace is affine cloud, switch to local workspace
|
// if current workspace is affine cloud, switch to local workspace
|
||||||
if (currentWorkspace?.flavour === WorkspaceFlavour.AFFINE_CLOUD) {
|
if (currentWorkspace?.flavour === WorkspaceFlavour.AFFINE_CLOUD) {
|
||||||
|
|||||||
Reference in New Issue
Block a user