mirror of
https://github.com/toeverything/AFFiNE.git
synced 2026-07-19 11:06:25 +08:00
refactor: using unified nanoid (#4519)
This commit is contained in:
@@ -1,5 +1,5 @@
|
||||
import { uuidv4 } from '@blocksuite/store';
|
||||
import { atom } from 'jotai';
|
||||
import { nanoid } from 'nanoid';
|
||||
|
||||
export type Notification = {
|
||||
key?: string;
|
||||
@@ -42,7 +42,7 @@ export const removeNotificationAtom = atom(null, (_, set, key: string) => {
|
||||
export const pushNotificationAtom = atom<null, [Notification], void>(
|
||||
null,
|
||||
(_, set, newNotification) => {
|
||||
newNotification.key = newNotification.key || uuidv4();
|
||||
newNotification.key = newNotification.key || nanoid();
|
||||
const key = newNotification.key;
|
||||
const removeNotification = () =>
|
||||
set(notificationsBaseAtom, notifications =>
|
||||
|
||||
@@ -8,9 +8,9 @@ import {
|
||||
RemoveIcon,
|
||||
SaveIcon,
|
||||
} from '@blocksuite/icons';
|
||||
import { uuidv4 } from '@blocksuite/store';
|
||||
import { Button } from '@toeverything/components/button';
|
||||
import { Modal } from '@toeverything/components/modal';
|
||||
import { nanoid } from 'nanoid';
|
||||
import { useCallback, useMemo, useState } from 'react';
|
||||
|
||||
import { Input, ScrollableContainer } from '../../..';
|
||||
@@ -280,7 +280,7 @@ export const SaveCollectionButton = ({
|
||||
const handleClick = useCallback(() => {
|
||||
changeShow(true);
|
||||
setInit({
|
||||
id: uuidv4(),
|
||||
id: nanoid(),
|
||||
name: '',
|
||||
filterList,
|
||||
workspaceId,
|
||||
|
||||
Reference in New Issue
Block a user