Skip to content

There can be more than Notion and Miro. AFFiNE(pronounced [ə‘fain]) is a next-gen knowledge base that brings planning, sorting and creating all together. Privacy first, open-source, customizable and ready to use.

fix: activities make chrome crash;

mitsuhatu986b9f45a44b
diff --git a/libs/components/layout/src/workspace-sidebar/activities/activities.tsx b/libs/components/layout/src/workspace-sidebar/activities/activities.tsx
index 9efe5ebd55..3de73c78df 100644
--- a/libs/components/layout/src/workspace-sidebar/activities/activities.tsx
+++ b/libs/components/layout/src/workspace-sidebar/activities/activities.tsx
@@ -45,23 +45,27 @@ const StyledWrapper = styled('div')({
});
export const Activities = () => {
+ const navigate = useNavigate();
const { user, currentSpaceId } = useUserAndSpaces();
- const [recenPages, setRecentPages] = useState([]);
+ const [recentPages, setRecentPages] = useState([]);
+ const userId = user?.id;
const fetchRecentPages = useCallback(async () => {
- if (!user || !currentSpaceId) {
+ if (!userId || !currentSpaceId) {
return;
}
const recent_pages = await services.api.userConfig.getRecentPages(
currentSpaceId,
- user.id
+ userId
);
setRecentPages(recent_pages);
- }, [user, currentSpaceId]);
+ }, [userId, currentSpaceId]);
useEffect(() => {
- fetchRecentPages();
- }, [user, currentSpaceId]);
+ (async () => {
+ await fetchRecentPages();
+ })();
+ }, [fetchRecentPages]);
useEffect(() => {
let unobserve: () => void;
@@ -80,12 +84,10 @@ export const Activities = () => {
};
}, [currentSpaceId, fetchRecentPages]);
- const navigate = useNavigate();
-
return (
<StyledWrapper>
<List>
- {recenPages.map(({ id, title, lastOpenTime }) => {
+ {recentPages.map(({ id, title, lastOpenTime }) => {
return (
<ListItem className="item" key={id}>
<ListItemButton