mirror of
https://github.com/toeverything/AFFiNE.git
synced 2026-07-25 14:28:51 +08:00
Merge branch 'feat/filesystem_and_search' of https://github.com/toeverything/AFFiNE into feat/filesystem_and_search
This commit is contained in:
@@ -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) => {
|
||||
|
||||
+3
-3
@@ -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 => {
|
||||
|
||||
Reference in New Issue
Block a user