From ae8a00527168b13aa59ddc2fbd1f88a0f1e2669c Mon Sep 17 00:00:00 2001
From: Florian Dold
Date: Fri, 1 Nov 2019 18:39:23 +0100
Subject: protocol changes
---
src/webex/pages/pay.tsx | 14 +++++++++++++-
src/webex/wxApi.ts | 1 +
2 files changed, 14 insertions(+), 1 deletion(-)
(limited to 'src/webex')
diff --git a/src/webex/pages/pay.tsx b/src/webex/pages/pay.tsx
index 579688db3..7f2a174b7 100644
--- a/src/webex/pages/pay.tsx
+++ b/src/webex/pages/pay.tsx
@@ -53,6 +53,11 @@ function TalerPayDialog({ talerPayUri }: { talerPayUri: string }) {
return Loading payment information ...;
}
+ let insufficientBalance = false;
+ if (payStatus.status == "insufficient-balance") {
+ insufficientBalance = true;
+ }
+
if (payStatus.status === "error") {
return Error: {payStatus.error};
}
@@ -93,7 +98,7 @@ function TalerPayDialog({ talerPayUri }: { talerPayUri: string }) {
const doPayment = async () => {
if (payStatus.status !== "payment-possible") {
- throw Error("invalid state");
+ throw Error(`invalid state: ${payStatus.status}`);
}
const proposalId = payStatus.proposalId;
setNumTries(numTries + 1);
@@ -128,6 +133,12 @@ function TalerPayDialog({ talerPayUri }: { talerPayUri: string }) {
)}
+ {insufficientBalance ? (
+
+
Unable to pay: Your balance is insufficient.
+
+ ) : null}
+
{payErrMsg ? (
Payment failed: {payErrMsg}
@@ -142,6 +153,7 @@ function TalerPayDialog({ talerPayUri }: { talerPayUri: string }) {
doPayment()}>
{i18n.str`Confirm payment`}
diff --git a/src/webex/wxApi.ts b/src/webex/wxApi.ts
index 65c14ac48..39c31ca51 100644
--- a/src/webex/wxApi.ts
+++ b/src/webex/wxApi.ts
@@ -86,6 +86,7 @@ async function callBackend
(
return new Promise((resolve, reject) => {
chrome.runtime.sendMessage({ type, detail }, (resp) => {
if (typeof resp === "object" && resp && resp.error) {
+ console.warn("response error:", resp)
const e = new WalletApiError(resp.error.message, resp.error);
reject(e);
} else {
--
cgit v1.2.3
From d6a3a54d28a5d1e21cc3cca9927c78f674044531 Mon Sep 17 00:00:00 2001
From: Florian Dold
Date: Sat, 2 Nov 2019 00:46:57 +0100
Subject: installation popup in FF
---
src/webex/background.ts | 2 +-
src/webex/pages/tip.tsx | 2 +-
src/webex/wxBackend.ts | 19 +++++++++++++------
3 files changed, 15 insertions(+), 8 deletions(-)
(limited to 'src/webex')
diff --git a/src/webex/background.ts b/src/webex/background.ts
index 3c63f323e..dbc540df4 100644
--- a/src/webex/background.ts
+++ b/src/webex/background.ts
@@ -23,7 +23,7 @@
/**
* Imports.
*/
-import {wxMain} from "./wxBackend";
+import { wxMain } from "./wxBackend";
window.addEventListener("load", () => {
wxMain();
diff --git a/src/webex/pages/tip.tsx b/src/webex/pages/tip.tsx
index 0a066053b..148b8203c 100644
--- a/src/webex/pages/tip.tsx
+++ b/src/webex/pages/tip.tsx
@@ -88,7 +88,7 @@ function TipDisplay(props: { talerTipUri: string }) {