mirror of
https://github.com/toeverything/AFFiNE.git
synced 2024-11-27 05:33:10 +03:00
fix: type error
This commit is contained in:
parent
a80e15042a
commit
e208ab6033
@ -28,12 +28,9 @@ export const AppStateProvider = ({
|
||||
if (dataCenter.workspaces.length === 0) {
|
||||
await createDefaultWorkspace(dataCenter);
|
||||
}
|
||||
let currentWorkspace = appState.currentWorkspace;
|
||||
if (!currentWorkspace) {
|
||||
currentWorkspace = await dataCenter.loadWorkspace(
|
||||
dataCenter.workspaces[0].id
|
||||
);
|
||||
}
|
||||
const currentWorkspace = await dataCenter.loadWorkspace(
|
||||
dataCenter.workspaces[0].id
|
||||
);
|
||||
const currentMetaWorkSpace = dataCenter.workspaces.find(item => {
|
||||
return item.id === currentWorkspace.room;
|
||||
});
|
||||
@ -53,7 +50,7 @@ export const AppStateProvider = ({
|
||||
};
|
||||
|
||||
init();
|
||||
}, [appState.currentWorkspace]);
|
||||
}, []);
|
||||
|
||||
useEffect(() => {
|
||||
if (!appState?.currentWorkspace) {
|
||||
@ -116,6 +113,9 @@ export const AppStateProvider = ({
|
||||
currentWorkspace: workspace,
|
||||
currentWorkspaceId: workspaceId,
|
||||
currentMetaWorkSpace: currentMetaWorkSpace ?? null,
|
||||
pageList: currentWorkspace.meta.pageMetas as PageMeta[],
|
||||
currentPage: null,
|
||||
editor: null,
|
||||
});
|
||||
|
||||
return workspace;
|
||||
|
@ -1,4 +1,4 @@
|
||||
import { DataCenter, User, Workspace } from '@affine/datacenter';
|
||||
import { DataCenter, User, WorkspaceInfo } from '@affine/datacenter';
|
||||
import type { EditorContainer } from '@blocksuite/editor';
|
||||
|
||||
import type {
|
||||
@ -18,9 +18,9 @@ export interface PageMeta extends StorePageMeta {
|
||||
export type AppStateValue = {
|
||||
dataCenter: DataCenter;
|
||||
user: User | null;
|
||||
workspaceList: Workspace[];
|
||||
workspaceList: WorkspaceInfo[];
|
||||
currentWorkspace: StoreWorkspace;
|
||||
currentMetaWorkSpace: Workspace | null;
|
||||
currentMetaWorkSpace: WorkspaceInfo | null;
|
||||
currentWorkspaceId: string;
|
||||
pageList: PageMeta[];
|
||||
currentPage: StorePage | null;
|
||||
|
Loading…
Reference in New Issue
Block a user