From 655c5fc18a22ae167160dd93e53d87e130fa9afa Mon Sep 17 00:00:00 2001
From: Sebastian <sebasjm@gmail.com>
Date: Thu, 8 Jul 2021 15:23:53 -0300
Subject: add more backup stories, sync by one provider

---
 packages/taler-wallet-webextension/src/popup/ProviderAddPage.tsx | 9 ++++-----
 1 file changed, 4 insertions(+), 5 deletions(-)

(limited to 'packages/taler-wallet-webextension/src/popup/ProviderAddPage.tsx')

diff --git a/packages/taler-wallet-webextension/src/popup/ProviderAddPage.tsx b/packages/taler-wallet-webextension/src/popup/ProviderAddPage.tsx
index 1e4a44df1..ac22a5f83 100644
--- a/packages/taler-wallet-webextension/src/popup/ProviderAddPage.tsx
+++ b/packages/taler-wallet-webextension/src/popup/ProviderAddPage.tsx
@@ -5,6 +5,7 @@ import * as wxApi from "../wxApi";
 
 interface Props {
   currency: string;
+  onBack: () => void;
 }
 
 function getJsonIfOk(r: Response) {
@@ -20,16 +21,14 @@ function getJsonIfOk(r: Response) {
 }
 
 
-export function ProviderAddPage({ }: Props): VNode {
+export function ProviderAddPage({ onBack }: Props): VNode {
   const [verifying, setVerifying] = useState<{ url: string, provider: BackupBackupProviderTerms } | undefined>(undefined)
   const [readingTerms, setReadingTerms] = useState<boolean | undefined>(undefined)
   const alreadyCheckedTheTerms = readingTerms === false
 
   if (!verifying) {
     return <SetUrlView
-      onCancel={() => {
-        setVerifying(undefined);
-      }}
+      onCancel={onBack}
       onVerify={(url) => {
         return fetch(`${url}/config`)
           .catch(e => { throw new Error(`Network error`) })
@@ -56,7 +55,7 @@ export function ProviderAddPage({ }: Props): VNode {
       setReadingTerms(true)
     }}
     onConfirm={() => {
-      wxApi.addBackupProvider(verifying.url).then(_ => history.go(-1))
+      wxApi.addBackupProvider(verifying.url).then(onBack)
     }}
 
   />
-- 
cgit v1.2.3

