mirror of
https://github.com/toeverything/AFFiNE.git
synced 2026-02-13 21:05:19 +00:00
Merge branch 'feat/datacenter' of https://github.com/toeverything/AFFiNE into feat/datacenter
This commit is contained in:
@@ -1,8 +1,6 @@
|
||||
import { useState, useEffect } from 'react';
|
||||
import { useAppState } from '@/providers/app-state-provider';
|
||||
import { useRouter } from 'next/router';
|
||||
const defaultOutLineWorkspaceId = 'affine';
|
||||
// 'local-first-' + '85b4ca0b9081421d903bbc2501ea280f';
|
||||
// It is a fully effective hook
|
||||
// Cause it not just ensure workspace loaded, but also have router change.
|
||||
export const useEnsureWorkspace = () => {
|
||||
@@ -35,9 +33,8 @@ export const useEnsureWorkspace = () => {
|
||||
// return;
|
||||
// }
|
||||
|
||||
const workspaceId = user
|
||||
? (router.query.workspaceId as string) || workspaceList[0]?.id
|
||||
: (router.query.workspaceId as string) || defaultOutLineWorkspaceId;
|
||||
const workspaceId =
|
||||
(router.query.workspaceId as string) || workspaceList[0]?.id;
|
||||
|
||||
loadWorkspace(workspaceId).finally(() => {
|
||||
console.log('workspaceId: ', workspaceId);
|
||||
|
||||
Reference in New Issue
Block a user