aboutsummaryrefslogtreecommitdiff
path: root/packages/taler-wallet-webextension
diff options
context:
space:
mode:
authorFlorian Dold <florian@dold.me>2022-04-12 20:55:34 +0200
committerFlorian Dold <florian@dold.me>2022-04-12 20:55:34 +0200
commitf3d8b4474302a00fd923581046b0f5828a4c5976 (patch)
tree973c69498cb822580c1ad3f42798768637e9f1fb /packages/taler-wallet-webextension
parent1e92093a50962f4702339e872caa4f82af90af70 (diff)
copyright headers
Diffstat (limited to 'packages/taler-wallet-webextension')
-rw-r--r--packages/taler-wallet-webextension/src/context/devContext.ts23
1 files changed, 20 insertions, 3 deletions
diff --git a/packages/taler-wallet-webextension/src/context/devContext.ts b/packages/taler-wallet-webextension/src/context/devContext.ts
index edd52c11d..1ce483d8d 100644
--- a/packages/taler-wallet-webextension/src/context/devContext.ts
+++ b/packages/taler-wallet-webextension/src/context/devContext.ts
@@ -34,14 +34,31 @@ const Context = createContext<Type>({
export const useDevContext = (): Type => useContext(Context);
-export const DevContextProviderForTesting = ({ value, children }: { value: boolean, children: any }): VNode => {
- return h(Context.Provider, { value: { devMode: value, toggleDevMode: () => { null } }, children });
+export const DevContextProviderForTesting = ({
+ value,
+ children,
+}: {
+ value: boolean;
+ children: any;
+}): VNode => {
+ return h(Context.Provider, {
+ value: {
+ devMode: value,
+ toggleDevMode: () => {
+ null;
+ },
+ },
+ children,
+ });
};
export const DevContextProvider = ({ children }: { children: any }): VNode => {
const [value, setter] = useLocalStorage("devMode");
const devMode = value === "true";
const toggleDevMode = (): void => setter((v) => (!v ? "true" : undefined));
- children = children.length === 1 && typeof children === "function" ? children({ devMode }) : children;
+ children =
+ children.length === 1 && typeof children === "function"
+ ? children({ devMode })
+ : children;
return h(Context.Provider, { value: { devMode, toggleDevMode }, children });
};