feat: simplify id rules

This commit is contained in:
tzhangchi
2022-12-23 21:41:03 +08:00
parent 17d7f44d48
commit 7aff0ba7d8
2 changed files with 4 additions and 2 deletions
@@ -9,7 +9,7 @@ export const useEnsureWorkspace = () => {
const { workspacesMeta, loadWorkspace, synced, user } = useAppState();
const router = useRouter();
const defaultOutLineWorkspaceId =
'local-first-' + '85b4ca0b-9081-421d-903b-bc2501ea280f';
'local-first-' + '85b4ca0b9081421d903bbc2501ea280f';
// const defaultOutLineWorkspaceId = '99ce7eb7';
// console.log(defaultOutLineWorkspaceId);
useEffect(() => {
@@ -153,7 +153,9 @@ export const AppStateProvider = ({ children }: { children?: ReactNode }) => {
Promise.resolve(null)
);
createPage.current = (pageId: string = uuidv4IdGenerator()) =>
createPage.current = (
pageId: string = uuidv4IdGenerator().replaceAll('-', '')
) =>
new Promise<string | null>(resolve => {
const { currentWorkspace } = state;
if (!currentWorkspace) {