Fix Client Config async loading (#12308)
Fix ClientConfig async loading --------- Co-authored-by: Félix Malfait <felix.malfait@gmail.com> Co-authored-by: Félix Malfait <felix@twenty.com>
This commit is contained in:
@ -1,11 +1,21 @@
|
||||
import { createState } from 'twenty-ui/utilities';
|
||||
import { ClientConfig } from '~/generated/graphql';
|
||||
|
||||
type ClientConfigApiStatus = {
|
||||
isLoaded: boolean;
|
||||
isLoading: boolean;
|
||||
isErrored: boolean;
|
||||
error?: Error;
|
||||
data?: { clientConfig: ClientConfig };
|
||||
};
|
||||
|
||||
export const clientConfigApiStatusState = createState<ClientConfigApiStatus>({
|
||||
key: 'clientConfigApiStatus',
|
||||
defaultValue: { isLoaded: false, isErrored: false, error: undefined },
|
||||
defaultValue: {
|
||||
isLoaded: false,
|
||||
isLoading: false,
|
||||
isErrored: false,
|
||||
error: undefined,
|
||||
data: undefined,
|
||||
},
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user