refactor: use nano id (#1234)

This commit is contained in:
Himself65
2023-03-01 12:16:36 -06:00
committed by GitHub
parent f888a9e6e0
commit 0df288ba2c
4 changed files with 10 additions and 10 deletions

View File

@@ -1,5 +1,5 @@
import { setUpLanguage, useTranslation } from '@affine/i18n';
import { assertExists, uuidv4 } from '@blocksuite/store';
import { assertExists, nanoid } from '@blocksuite/store';
import { useAtom, useAtomValue } from 'jotai';
import { atomWithStorage } from 'jotai/utils';
import { useRouter } from 'next/router';
@@ -84,7 +84,7 @@ export const WorkspaceLayout: React.FC<React.PropsWithChildren> = ({
[currentWorkspace, isPublicWorkspace, router]
);
const handleCreatePage = useCallback(async () => {
return helper.createPage(uuidv4());
return helper.createPage(nanoid());
}, [helper]);
const handleOpenWorkspaceListModal = useCallback(() => {
setOpenWorkspacesModal(true);