fix: unable to add a second collection (#3405)

This commit is contained in:
JimmFly 2023-07-27 13:37:42 +08:00 committed by GitHub
parent bc263e7afb
commit ba53c74130
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -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