mirror of
https://github.com/toeverything/AFFiNE.git
synced 2026-02-27 10:52:40 +08:00
Merge branch 'feat/datacenter' of https://github.com/toeverything/AFFiNE into feat/datacenter
This commit is contained in:
@@ -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) {
|
||||
|
||||
Reference in New Issue
Block a user