From ba53c74130ba84c5623e8e02fbb2c726402162c8 Mon Sep 17 00:00:00 2001 From: JimmFly Date: Thu, 27 Jul 2023 13:37:42 +0800 Subject: [PATCH] fix: unable to add a second collection (#3405) --- .../collections/add-collection-button.tsx | 19 ++++++++----------- 1 file changed, 8 insertions(+), 11 deletions(-) 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 ( <>