mirror of
https://github.com/toeverything/AFFiNE.git
synced 2026-08-06 11:59:51 +08:00
fix: add router defend
This commit is contained in:
@@ -9,7 +9,7 @@ export const useLoadWorkspace = () => {
|
||||
const workspaceId = router.query.workspaceId as string;
|
||||
|
||||
useEffect(() => {
|
||||
loadWorkspace?.current?.(workspaceId);
|
||||
loadWorkspace?.(workspaceId);
|
||||
}, [workspaceId, loadWorkspace]);
|
||||
|
||||
return currentWorkspaceId === workspaceId ? currentWorkspace : null;
|
||||
@@ -29,7 +29,7 @@ export const useLoadPage = () => {
|
||||
}
|
||||
const page = pageId ? workspace?.getPage(pageId) : null;
|
||||
if (page) {
|
||||
loadPage?.current?.(pageId);
|
||||
loadPage?.(pageId);
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -39,7 +39,7 @@ export const useLoadPage = () => {
|
||||
return;
|
||||
}
|
||||
|
||||
createPage?.current?.()?.then(async pageId => {
|
||||
createPage?.()?.then(async pageId => {
|
||||
if (!pageId) {
|
||||
return;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user