Skip to content

Commit b0ed742

Browse files
committed
afterscan and checkout
1 parent 83c5ad6 commit b0ed742

File tree

2 files changed

+17
-12
lines changed

2 files changed

+17
-12
lines changed

assets_js_bitrequest_core.js

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1917,11 +1917,13 @@ function continue_cpd() {
19171917

19181918
// Scan address one last time
19191919
function after_scan(api_data) {
1920-
loader(true);
1921-
loadertext(translate("lookuppayment", {
1922-
"currency": request.payment,
1923-
"blockexplorer": api_data.name
1924-
}));
1920+
if (glob_inframe) {
1921+
loader(true);
1922+
loadertext(translate("lookuppayment", {
1923+
"currency": request.payment,
1924+
"blockexplorer": api_data.name
1925+
}));
1926+
}
19251927
if (!glob_inframe) {
19261928
hide_paymentdialog();
19271929
}

assets_js_lib_bitrequest_checkout.js

Lines changed: 10 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
1-
const html_node = document.documentElement;
1+
const html_node = document.documentElement,
2+
base_url = "https://bitrequest.github.io";
23

34
document.addEventListener("DOMContentLoaded", function() {
45
checkout();
@@ -12,11 +13,9 @@ function checkout() {
1213
document.addEventListener("click", function(e) {
1314
const target = e.target;
1415
if (!target.matches(".br_checkout")) return;
15-
1616
e.preventDefault();
1717
const checkout_url = target.getAttribute("href"),
1818
br_frame = document.querySelector("#br_framebox iframe");
19-
2019
if (br_frame) {
2120
showloader();
2221
br_frame.setAttribute("src", checkout_url);
@@ -39,7 +38,11 @@ function append_iframe(framesrc) {
3938
function iframe_loaded() {
4039
const requestframe = document.querySelector("#br_framebox iframe");
4140
requestframe.addEventListener("load", function() {
42-
if (requestframe.getAttribute("src")) {
41+
const frame_source = requestframe.getAttribute("src");
42+
if (frame_source) {
43+
if (frame_source === base_url) {
44+
return
45+
}
4346
showframe();
4447
}
4548
});
@@ -92,7 +95,7 @@ function closeframe() {
9295
html_node.classList.remove("showframe");
9396
const iframe = document.querySelector("#br_framebox iframe");
9497
if (iframe) {
95-
iframe.removeAttribute("src");
98+
iframe.setAttribute("src", base_url);
9699
}
97100
}, 400);
98101
}
@@ -128,11 +131,11 @@ function keyup() {
128131
if (e.key === "Escape" || e.keyCode === 27) {
129132
if (html_node.classList.contains("slide_loader")) {
130133
closeloader();
131-
return false;
134+
return
132135
}
133136
if (html_node.classList.contains("showframe")) {
134137
closeframe_confirm();
135-
return false;
138+
return
136139
}
137140
}
138141
});

0 commit comments

Comments
 (0)