-
-
-
}
- active={allPageActive}
- path={paths.all(currentWorkspaceId)}
- >
-
- {t['com.affine.workspaceSubPath.all']()}
-
-
-
- {runtimeConfig.enableNewSettingModal ? (
-
}
- onClick={onOpenSettingModal}
- >
-
- {t['com.affine.settingSidebar.title']()}
-
-
- ) : null}
-
-
-
-
-
-
-
-
-
- {/* fixme: remove the following spacer */}
-
-
+
}
- active={trashActive || trashDroppable.isOver}
- path={paths.trash(currentWorkspaceId)}
+ icon={}
+ active={allPageActive}
+ path={paths.all(currentWorkspaceId)}
>
-
- {t['com.affine.workspaceSubPath.trash']()}
+
+ {t['com.affine.workspaceSubPath.all']()}
-
-
-
-
- {environment.isDesktop ? : }
-
-
-
-
- );
-};
+
+ {runtimeConfig.enableNewSettingModal ? (
+
}
+ onClick={onOpenSettingModal}
+ >
+
+ {t['com.affine.settingSidebar.title']()}
+
+
+ ) : null}
+
+
+
+
+
+
+
+
+ {/* fixme: remove the following spacer */}
+
+
+ }
+ active={trashActive || trashDroppable.isOver}
+ path={paths.trash(currentWorkspaceId)}
+ >
+
+ {t['com.affine.workspaceSubPath.trash']()}
+
+
+
+
+
+
+ {environment.isDesktop ? : }
+
+
+
+
+ );
+ }
+);
+
+RootAppSidebar.displayName = 'memo(RootAppSidebar)';
diff --git a/packages/frontend/core/src/components/workspace-selector/index.tsx b/packages/frontend/core/src/components/workspace-selector/index.tsx
index 93cce9948a..156407dfe0 100644
--- a/packages/frontend/core/src/components/workspace-selector/index.tsx
+++ b/packages/frontend/core/src/components/workspace-selector/index.tsx
@@ -1,6 +1,7 @@
import { Menu } from '@affine/component';
+import { useService, WorkspacesService } from '@toeverything/infra';
import { useAtom } from 'jotai';
-import { Suspense, useCallback } from 'react';
+import { useCallback, useEffect } from 'react';
import { openWorkspaceListModalAtom } from '../../atoms';
import { mixpanel } from '../../utils';
@@ -21,16 +22,21 @@ export const WorkspaceSelector = () => {
setOpenUserWorkspaceList(true);
}, [setOpenUserWorkspaceList]);
+ const workspaceManager = useService(WorkspacesService);
+
+ // revalidate workspace list when open workspace list
+ useEffect(() => {
+ if (isUserWorkspaceListOpened) {
+ workspaceManager.list.revalidate();
+ }
+ }, [workspaceManager, isUserWorkspaceListOpened]);
+
return (
);
};
-
-export const WorkspaceFallback = (): ReactElement => {
- return (
-