From fb6aff76d2152d95caa2ba6cb0d91cb01e0687fe Mon Sep 17 00:00:00 2001 From: Sebastian Date: Mon, 6 Jun 2022 00:09:25 -0300 Subject: prettier --- .../src/hooks/useExtendedPermissions.ts | 22 ++++++++++++---------- 1 file changed, 12 insertions(+), 10 deletions(-) (limited to 'packages/taler-wallet-webextension/src/hooks/useExtendedPermissions.ts') diff --git a/packages/taler-wallet-webextension/src/hooks/useExtendedPermissions.ts b/packages/taler-wallet-webextension/src/hooks/useExtendedPermissions.ts index e3ea56d1b..08bb39668 100644 --- a/packages/taler-wallet-webextension/src/hooks/useExtendedPermissions.ts +++ b/packages/taler-wallet-webextension/src/hooks/useExtendedPermissions.ts @@ -24,9 +24,9 @@ export function useExtendedPermissions(): ToggleHandler { const [enabled, setEnabled] = useState(false); const [error, setError] = useState(); const toggle = async (): Promise => { - return handleExtendedPerm(enabled, setEnabled).catch(e => { - setError(TalerError.fromException(e)) - }) + return handleExtendedPerm(enabled, setEnabled).catch((e) => { + setError(TalerError.fromException(e)); + }); }; useEffect(() => { @@ -40,12 +40,15 @@ export function useExtendedPermissions(): ToggleHandler { value: enabled, button: { onClick: toggle, - error - } + error, + }, }; } -async function handleExtendedPerm(isEnabled: boolean, onChange: (value: boolean) => void): Promise { +async function handleExtendedPerm( + isEnabled: boolean, + onChange: (value: boolean) => void, +): Promise { if (!isEnabled) { // We set permissions here, since apparently FF wants this to be done // as the result of an input event ... @@ -60,11 +63,10 @@ async function handleExtendedPerm(isEnabled: boolean, onChange: (value: boolean) onChange(res.newValue); } else { try { - await wxApi.toggleHeaderListener(false).then(r => onChange(r.newValue)); + await wxApi.toggleHeaderListener(false).then((r) => onChange(r.newValue)); } catch (e) { - console.log(e) + console.log(e); } - } - return + return; } -- cgit v1.2.3