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

This commit is contained in:
DiamondThree
2023-01-09 17:25:17 +08:00

View File

@@ -81,6 +81,17 @@ export const AppStateProvider = ({
};
}, [appState]);
useEffect(() => {
const { dataCenter } = appState;
// FIXME: onWorkspacesChange should have dispose function
dataCenter?.onWorkspacesChange(() => {
setAppState({
...appState,
workspaceList: dataCenter.workspaces,
});
});
}, [appState]);
const loadPage = (pageId: string) => {
const { currentWorkspace, currentPage } = appState;
if (pageId === currentPage?.id) {