aboutsummaryrefslogtreecommitdiff
path: root/packages/aml-backoffice-ui/src/context/config.ts
diff options
context:
space:
mode:
Diffstat (limited to 'packages/aml-backoffice-ui/src/context/config.ts')
-rw-r--r--packages/aml-backoffice-ui/src/context/config.ts3
1 files changed, 2 insertions, 1 deletions
diff --git a/packages/aml-backoffice-ui/src/context/config.ts b/packages/aml-backoffice-ui/src/context/config.ts
index 2df7ff40d..ba16482be 100644
--- a/packages/aml-backoffice-ui/src/context/config.ts
+++ b/packages/aml-backoffice-ui/src/context/config.ts
@@ -29,11 +29,12 @@ export type Type = {
url: URL,
config: TalerExchangeApi.ExchangeVersionResponse,
api: TalerExchangeHttpClient,
-};
+} | undefined;
const Context = createContext<Type>(undefined as any);
export const useExchangeApiContext = (): Type => useContext(Context);
+export const useMaybeExchangeApiContext = (): Type | undefined => useContext(Context);
export function ExchangeApiContextTesting({ config, children }: { config: TalerExchangeApi.ExchangeVersionResponse, children?: ComponentChildren; }): VNode {
return h(Context.Provider, {