mirror of
https://github.com/toeverything/AFFiNE.git
synced 2026-07-21 20:16:26 +08:00
feat: enable workspace cloud
This commit is contained in:
@@ -10,6 +10,7 @@ const WorkspaceIndex = () => {
|
||||
const { currentWorkspaceId, currentWorkspace } = useAppState();
|
||||
const { createPage } = usePageHelper();
|
||||
const { workspaceLoaded } = useEnsureWorkspace();
|
||||
console.log('workspaceLoaded: ', workspaceLoaded);
|
||||
|
||||
useEffect(() => {
|
||||
const initPage = async () => {
|
||||
@@ -17,6 +18,7 @@ const WorkspaceIndex = () => {
|
||||
return;
|
||||
}
|
||||
const savedPageId = currentWorkspace?.meta.pageMetas[0]?.id;
|
||||
console.log('savedPageId: ', savedPageId);
|
||||
if (savedPageId) {
|
||||
router.replace(`/workspace/${currentWorkspaceId}/${savedPageId}`);
|
||||
return;
|
||||
|
||||
@@ -11,6 +11,7 @@ export const WorkspaceIndex = () => {
|
||||
|
||||
useEffect(() => {
|
||||
if (workspaceLoaded) {
|
||||
console.log('workspaceLoaded: ', workspaceLoaded);
|
||||
router.push(`/workspace/${currentWorkspaceId}`);
|
||||
}
|
||||
}, [currentWorkspaceId, router, workspaceLoaded]);
|
||||
|
||||
Reference in New Issue
Block a user