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: unable to add a second collection (#3405)

JimmFlyba53c74130ba
diff --git a/apps/core/src/components/pure/workspace-slider-bar/collections/add-collection-button.tsx b/apps/core/src/components/pure/workspace-slider-bar/collections/add-collection-button.tsx
index 6c37e42c2c..2f2cf29674 100644
--- a/apps/core/src/components/pure/workspace-slider-bar/collections/add-collection-button.tsx
+++ b/apps/core/src/components/pure/workspace-slider-bar/collections/add-collection-button.tsx
@@ -7,7 +7,7 @@ import { useAFFiNEI18N } from '@affine/i18n/hooks';
import { PlusIcon } from '@blocksuite/icons';
import type { Workspace } from '@blocksuite/store';
import { uuidv4 } from '@blocksuite/store';
-import { useMemo, useState } from 'react';
+import { useState } from 'react';
import { useGetPageInfoById } from '../../../../hooks/use-get-page-info';
@@ -22,16 +22,13 @@ export const AddCollectionButton = ({
const setting = useCollectionManager(workspace.id);
const t = useAFFiNEI18N();
const [show, showUpdateCollection] = useState(false);
- const defaultCollection = useMemo(
- () => ({
- id: uuidv4(),
- name: '',
- pinned: true,
- filterList: [],
- workspaceId: workspace.id,
- }),
- [workspace.id]
- );
+ const defaultCollection = {
+ id: uuidv4(),
+ name: '',
+ pinned: true,
+ filterList: [],
+ workspaceId: workspace.id,
+ };
return (
<>
<IconButton