mirror of
https://github.com/toeverything/AFFiNE.git
synced 2026-02-12 12:28:42 +00:00
fix: first workspace create logic (#1773)
This commit is contained in:
@@ -1,7 +1,5 @@
|
||||
import { atomWithSyncStorage } from '@affine/jotai';
|
||||
import type { AccessTokenMessage } from '@affine/workspace/affine/login';
|
||||
import { atomWithStorage } from 'jotai/utils';
|
||||
|
||||
export const currentAffineUserAtom = atomWithStorage<AccessTokenMessage | null>(
|
||||
'affine-user-atom',
|
||||
null
|
||||
);
|
||||
export const currentAffineUserAtom =
|
||||
atomWithSyncStorage<AccessTokenMessage | null>('affine-user-atom', null);
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
import { atomWithSyncStorage } from '@affine/jotai';
|
||||
import type { WorkspaceFlavour } from '@affine/workspace/type';
|
||||
import { createStore } from 'jotai/index';
|
||||
import { atomWithStorage } from 'jotai/utils';
|
||||
|
||||
export type JotaiWorkspace = {
|
||||
id: string;
|
||||
@@ -9,7 +9,7 @@ export type JotaiWorkspace = {
|
||||
|
||||
// root primitive atom that stores the list of workspaces which could be used in the app
|
||||
// if a workspace is not in this list, it should not be used in the app
|
||||
export const jotaiWorkspacesAtom = atomWithStorage<JotaiWorkspace[]>(
|
||||
export const jotaiWorkspacesAtom = atomWithSyncStorage<JotaiWorkspace[]>(
|
||||
'jotai-workspaces',
|
||||
[]
|
||||
);
|
||||
|
||||
Reference in New Issue
Block a user