refactor: using unified nanoid (#4519)

This commit is contained in:
Alex Yang
2023-09-27 21:53:04 -05:00
committed by GitHub
parent 56f75160f3
commit 603f82ffc2
38 changed files with 258 additions and 183 deletions
+2 -1
View File
@@ -5,6 +5,7 @@ import { currentWorkspaceAtom } from '@toeverything/infra/atom';
import { type DBSchema, openDB } from 'idb';
import { atom } from 'jotai';
import { atomWithObservable } from 'jotai/utils';
import { nanoid } from 'nanoid';
import { Observable } from 'rxjs';
import type { Map as YMap } from 'yjs';
import { Doc as YDoc } from 'yjs';
@@ -116,7 +117,7 @@ const pageCollectionBaseAtom = atomWithObservable<Collection[]>(get => {
settingMap.set(
userId,
new YDoc({
guid: `${rootDoc.guid}:settings:${userId}`,
guid: nanoid(),
})
);
}