feat: local provider

This commit is contained in:
DarkSky
2023-01-02 18:55:53 +08:00
committed by DarkSky
parent b01703b836
commit 7fea77b64f
14 changed files with 464 additions and 142 deletions

View File

@@ -31,19 +31,18 @@ export const useEnsureWorkspace = () => {
return;
}
// If user is not login and input a custom workspaceId, jump to 404 page
if (
!user &&
router.query.workspaceId &&
router.query.workspaceId !== defaultOutLineWorkspaceId
) {
debugger;
router.push('/404');
return;
}
// if (
// !user &&
// router.query.workspaceId &&
// router.query.workspaceId !== defaultOutLineWorkspaceId
// ) {
// router.push('/404');
// return;
// }
const workspaceId = user
? (router.query.workspaceId as string) || workspacesMeta?.[0]?.id
: defaultOutLineWorkspaceId;
? (router.query.workspaceId as string) || workspacesMeta[0]?.id
: (router.query.workspaceId as string) || defaultOutLineWorkspaceId;
loadWorkspace(workspaceId).finally(() => {
setWorkspaceLoaded(true);