From 609397d95a73bdae55de41c47b19932e810d0320 Mon Sep 17 00:00:00 2001 From: Florian Dold Date: Fri, 1 May 2020 14:16:56 +0530 Subject: drastically reduce permissions for Web integration The old web integration with more permissions is still available on an opt-in basis. --- src/webex/pages/welcome.tsx | 57 ++++++++++++++++++++++++++++++++++++++------- 1 file changed, 49 insertions(+), 8 deletions(-) (limited to 'src/webex/pages/welcome.tsx') diff --git a/src/webex/pages/welcome.tsx b/src/webex/pages/welcome.tsx index eecbe2be5..5092d2dd8 100644 --- a/src/webex/pages/welcome.tsx +++ b/src/webex/pages/welcome.tsx @@ -24,8 +24,9 @@ import React, { useState, useEffect } from "react"; import { getDiagnostics } from "../wxApi"; import { PageLink } from "../renderHtml"; import { WalletDiagnostics } from "../../types/walletTypes"; +import * as wxApi from "../wxApi"; -function Diagnostics(): JSX.Element { +function Diagnostics(): JSX.Element | null { const [timedOut, setTimedOut] = useState(false); const [diagnostics, setDiagnostics] = useState( undefined, @@ -55,7 +56,7 @@ function Diagnostics(): JSX.Element { if (diagnostics) { if (diagnostics.errors.length === 0) { - return

Running diagnostics ... everything looks fine.

; + return null; } else { return (
{ + const res = await wxApi.setExtendedPermissions(newVal); + setExtendedPermissions(res.newValue); + } + useEffect(() => { + async function getExtendedPermValue(): Promise { + const res = await wxApi.getExtendedPermissions() + setExtendedPermissions(res.newValue); + } + getExtendedPermValue(); + }); return ( <>

Thank you for installing the wallet.

-

First Steps

-

- Check out demo.taler.net for a - demo. -

-

Troubleshooting

+

Permissions

+
+ handleExtendedPerm(x.target.checked)} + type="checkbox" + id="checkbox-perm" + style={{ width: "1.5em", height: "1.5em", verticalAlign: "middle" }} + /> + + + (Enabling this option below will make using the wallet faster, but + requires more permissions from your browser.) + +
+

Next Steps

+ + Try the demo » + + + Learn how to top up your wallet balance » + ); } -- cgit v1.2.3