feat: update the strategy of workspace id and page id generator

This commit is contained in:
tzhangchi
2022-12-23 21:34:07 +08:00
parent 3ac3a97794
commit 6047243d2e
2 changed files with 10 additions and 4 deletions
@@ -5,7 +5,6 @@ import {
token,
AccessTokenMessage,
getWorkspaces,
downloadWorkspace,
} from '@pathfinder/data-services';
import { AppState, AppStateContext } from './context';
import type {
@@ -15,6 +14,7 @@ import type {
} from './context';
import { Page, Workspace as StoreWorkspace } from '@blocksuite/store';
import { EditorContainer } from '@blocksuite/editor';
import { uuidv4 as uuidv4IdGenerator } from '@blocksuite/store';
const DynamicBlocksuite = dynamic(() => import('./dynamic-blocksuite'), {
ssr: false,
});
@@ -153,7 +153,7 @@ export const AppStateProvider = ({ children }: { children?: ReactNode }) => {
Promise.resolve(null)
);
createPage.current = (pageId: string = Date.now().toString()) =>
createPage.current = (pageId: string = 'lp-' + uuidv4IdGenerator()) =>
new Promise<string | null>(resolve => {
const { currentWorkspace } = state;
if (!currentWorkspace) {