fix: first workspace create logic (#1773)

This commit is contained in:
Peng Xiao
2023-04-01 01:40:30 +08:00
committed by GitHub
parent fd65dd66a1
commit 7299efe16a
20 changed files with 158 additions and 87 deletions

View File

@@ -1,5 +1,5 @@
import { atomWithSyncStorage } from '@affine/jotai';
import { atom, useAtom, useAtomValue, useSetAtom } from 'jotai';
import { atomWithStorage } from 'jotai/utils';
import { useCallback } from 'react';
import {
@@ -17,7 +17,7 @@ export const currentWorkspaceAtom = atom<Promise<AllWorkspace | null>>(
}
);
export const lastWorkspaceIdAtom = atomWithStorage<string | null>(
export const lastWorkspaceIdAtom = atomWithSyncStorage<string | null>(
'last_workspace_id',
null
);