Provide initialSnapshot to logout recoil state update snapshot (#4929)

This commit is contained in:
martmull 2024-04-11 18:26:55 +02:00 committed by GitHub
parent bc3930911e
commit e6a5a63acf
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 5 additions and 1 deletions

View File

@ -10,6 +10,7 @@ import {
import { currentWorkspaceMemberState } from '@/auth/states/currentWorkspaceMemberState';
import { currentWorkspaceState } from '@/auth/states/currentWorkspaceState';
import { isCurrentUserLoadedState } from '@/auth/states/isCurrentUserLoadingState.ts';
import { isVerifyPendingState } from '@/auth/states/isVerifyPendingState';
import { workspacesState } from '@/auth/states/workspaces';
import { authProvidersState } from '@/client-config/states/authProvidersState';
@ -169,9 +170,13 @@ export const useAuth = () => {
const isClientConfigLoaded = snapshot
.getLoadable(isClientConfigLoadedState)
.getValue();
const isCurrentUserLoaded = snapshot
.getLoadable(isCurrentUserLoadedState)
.getValue();
const initialSnapshot = emptySnapshot.map(({ set }) => {
set(isClientConfigLoadedState, isClientConfigLoaded);
set(isCurrentUserLoadedState, isCurrentUserLoaded);
set(iconsState, iconsValue);
set(authProvidersState, authProvidersValue);
set(billingState, billing);

View File

@ -32,7 +32,6 @@ export const DateFieldInput = ({
};
const handleEnter = (newDate: Nullable<Date>) => {
console.log('newDate enter', newDate);
onEnter?.(() => persistDate(newDate));
};