mirror of
https://github.com/btcpayserver/btcpayserver.git
synced 2025-03-03 09:29:10 +01:00
fix coinswitch...yet again
This commit is contained in:
parent
909f18f9c7
commit
139b588795
1 changed files with 20 additions and 20 deletions
|
@ -42,32 +42,32 @@
|
|||
|
||||
payment.on('Exchange:Ready', function(){
|
||||
waitForCoinSwitch();
|
||||
})
|
||||
});
|
||||
|
||||
payment.on("Exchange:Complete", function () {
|
||||
if(window.localStorage){
|
||||
window.localStorage.removeItem(toCurrencyAddress);
|
||||
}
|
||||
window.close();
|
||||
});
|
||||
|
||||
payment.on("Exchange:Initiated", function(orderId) {
|
||||
if(window.localStorage){
|
||||
window.localStorage.setItem(toCurrencyAddress,orderId);
|
||||
}
|
||||
});
|
||||
payment.on("Exchange:Closed", function () {
|
||||
window.close();
|
||||
window.postMessage("popup-closed", "*");
|
||||
});
|
||||
|
||||
function waitForCoinSwitch() {
|
||||
if (typeof payment.open !== "function") {
|
||||
setTimeout(waitForCoinSwitch, 1000);
|
||||
return;
|
||||
}
|
||||
payment.on("Exchange:Ready", function(){
|
||||
payment.open(config);
|
||||
});
|
||||
payment.on("Exchange:Complete", function () {
|
||||
if(window.localStorage){
|
||||
window.localStorage.removeItem(toCurrencyAddress);
|
||||
}
|
||||
window.close();
|
||||
});
|
||||
|
||||
payment.on("Exchange:Initiated", function(orderId) {
|
||||
if(window.localStorage){
|
||||
window.localStorage.setItem(toCurrencyAddress,orderId);
|
||||
}
|
||||
});
|
||||
payment.on("Exchange:Closed", function () {
|
||||
window.close();
|
||||
window.postMessage("popup-closed", "*");
|
||||
})
|
||||
payment.open(config);
|
||||
|
||||
}
|
||||
});
|
||||
</script>
|
||||
|
|
Loading…
Add table
Reference in a new issue