only hide page when doing payment

This commit is contained in:
Florian Dold 2017-12-01 03:17:32 +01:00
parent b8ccc7c990
commit f438305b6e
No known key found for this signature in database
GPG Key ID: D2E4F00F29D02A4B

View File

@ -184,7 +184,6 @@ function init() {
if (resp && resp.type === "pay") { if (resp && resp.type === "pay") {
logVerbose && console.log("doing taler.pay with", resp.payDetail); logVerbose && console.log("doing taler.pay with", resp.payDetail);
talerPay(resp.payDetail).then(handlePaymentResponse); talerPay(resp.payDetail).then(handlePaymentResponse);
document.documentElement.style.visibility = "hidden";
} }
}); });
} }
@ -338,7 +337,7 @@ function talerPay(msg: any): Promise<any> {
const uri = new URI(chrome.extension.getURL("/src/webex/pages/tip.html")); const uri = new URI(chrome.extension.getURL("/src/webex/pages/tip.html"));
const params = { tip_id: tipToken.tip_id, merchant_domain: merchantDomain }; const params = { tip_id: tipToken.tip_id, merchant_domain: merchantDomain };
const redirectUrl = uri.query(params).href(); const redirectUrl = uri.query(params).href();
window.location.href = redirectUrl; //window.location.href = redirectUrl;
return; return;
} }
@ -366,6 +365,9 @@ function talerPay(msg: any): Promise<any> {
return; return;
} }
// Don't show a flash of the fallback page when we're doing a payment.
document.documentElement.style.visibility = "hidden";
// current URL without fragment // current URL without fragment
const url = new URI(document.location.href).fragment("").href(); const url = new URI(document.location.href).fragment("").href();
const res = await wxApi.queryPayment(url); const res = await wxApi.queryPayment(url);