Merge branch 'feat/filesystem_and_search' of https://github.com/toeverything/AFFiNE into feat/filesystem_and_search

This commit is contained in:
tzhangchi
2022-12-23 19:45:11 +08:00
6 changed files with 18 additions and 11 deletions
@@ -4,10 +4,11 @@ import { useRouter } from 'next/router';
import { StyledPage, StyledWrapper } from './styles';
import { PropsWithChildren } from 'react';
import useEnsureWorkspace from '@/hooks/use-ensure-workspace';
import { PageLoading } from '@/components/loading';
export const WorkspaceDefender = ({ children }: PropsWithChildren) => {
const { workspaceLoaded } = useEnsureWorkspace();
return <>{workspaceLoaded ? children : null}</>;
return <>{workspaceLoaded ? children : <PageLoading />}</>;
};
export const WorkspaceLayout = ({ children }: PropsWithChildren) => {
@@ -67,11 +67,11 @@ export const WorkspaceCreate = ({ open, onClose }: WorkspaceCreateProps) => {
setCanCreate(true);
const blobId = await createDefaultHeadImg(workspaceName);
createWorkspace({ name: workspaceName, avatar: blobId })
.then(data => {
.then(async data => {
await refreshWorkspacesMeta();
// eslint-disable-next-line @typescript-eslint/ban-ts-comment
// @ts-ignore
router.push(`/workspace/${data.created_at}`);
refreshWorkspacesMeta();
router.push(`/workspace/${data.id}`);
onClose();
})
.catch(err => {