diff --git a/BTCPayServer/Views/Invoice/Checkout.cshtml b/BTCPayServer/Views/Invoice/Checkout.cshtml index 9f8ff1c02..abdcdcaec 100644 --- a/BTCPayServer/Views/Invoice/Checkout.cshtml +++ b/BTCPayServer/Views/Invoice/Checkout.cshtml @@ -183,6 +183,13 @@ +
+ + + + + +
diff --git a/BTCPayServer/wwwroot/css/normalizer.css b/BTCPayServer/wwwroot/css/normalizer.css index c37d4dc0f..d7d139328 100644 --- a/BTCPayServer/wwwroot/css/normalizer.css +++ b/BTCPayServer/wwwroot/css/normalizer.css @@ -10892,6 +10892,20 @@ bp-spinner { display: flex; } +.payment__spinner { + margin-top: 140px; + display: none; +} + + .payment__spinner > bp-spinner > svg { + margin: auto auto; + height: 60px; + width: 60px; + fill: gray; + animation: spin 0.55s linear infinite; + opacity: .85; + } + bp-refund-address.ng-valid .bitcoin-logo { opacity: 1; margin-left: 0; diff --git a/BTCPayServer/wwwroot/js/core.js b/BTCPayServer/wwwroot/js/core.js index 7f808a2f5..87a3b6c7d 100644 --- a/BTCPayServer/wwwroot/js/core.js +++ b/BTCPayServer/wwwroot/js/core.js @@ -193,13 +193,23 @@ function onDataCallback(jsonData) { window.parent.postMessage({ "invoiceId": srvModel.invoiceId, "status": newStatus }, "*"); } + // restoring qr code view only when currency is switched + if (jsonData.paymentMethodId == srvModel.paymentMethodId) { + $("#scan").show(); + $(".payment__spinner").hide(); + } + // updating ui checkoutCtrl.srvModel = jsonData; } function changeCurrency(currency) { - srvModel.paymentMethodId = currency; - fetchStatus(); + if (srvModel.paymentMethodId != currency) { + $("#scan").hide(); + $(".payment__spinner").show(); + srvModel.paymentMethodId = currency; + fetchStatus(); + } return false; }