refactor: remove sync storage (#2269)

This commit is contained in:
Himself65
2023-05-09 06:21:42 +08:00
committed by GitHub
parent 3a6be4510b
commit 95bc5cac49
9 changed files with 22 additions and 102 deletions

View File

@@ -1,5 +1,5 @@
import { atomWithSyncStorage } from '@affine/jotai';
import { useAtom, useAtomValue, useSetAtom } from 'jotai';
import { atomWithStorage } from 'jotai/utils';
import { useCallback } from 'react';
import { currentPageIdAtom, currentWorkspaceIdAtom } from '../../atoms';
@@ -11,7 +11,7 @@ import type { AllWorkspace } from '../../shared';
*/
export const currentWorkspaceAtom = rootCurrentWorkspaceAtom;
export const lastWorkspaceIdAtom = atomWithSyncStorage<string | null>(
export const lastWorkspaceIdAtom = atomWithStorage<string | null>(
'last_workspace_id',
null
);