fix(workspace): check affine login auth (#2070)

This commit is contained in:
Himself65
2023-04-21 20:44:29 -05:00
committed by GitHub
parent 2c95a0a757
commit 1ca9fb8ff4
19 changed files with 211 additions and 73 deletions

View File

@@ -1,6 +1,5 @@
import { DebugLogger } from '@affine/debug';
import { useTranslation } from '@affine/i18n';
import { WorkspaceFlavour } from '@affine/workspace/type';
import type { NextPage } from 'next';
import { useRouter } from 'next/router';
import { Suspense, useEffect } from 'react';
@@ -27,10 +26,7 @@ const IndexPageInner = () => {
const targetWorkspace =
(lastWorkspaceId &&
workspaces.find(({ id }) => id === lastWorkspaceId)) ||
// fixme(himself65):
// when affine workspace is expired and the first workspace is affine,
// the page will crash
workspaces.find(({ flavour }) => flavour === WorkspaceFlavour.LOCAL);
workspaces.at(0);
if (targetWorkspace) {
const pageId =