2024-05-06 07:40:17 +02:00
|
|
|
window.addEventListener("load", () => {
|
|
|
|
let $input = null;
|
|
|
|
initCameraScanningApp("Scan address or payment link", data => {
|
|
|
|
if (data.includes('?') || $input == null) {
|
|
|
|
document.getElementById("BIP21").value = data;
|
|
|
|
document.getElementById("SendForm").submit();
|
|
|
|
} else {
|
|
|
|
$input.value = data;
|
|
|
|
}
|
2022-08-31 12:27:06 +02:00
|
|
|
}, "scanModal");
|
2024-05-06 07:40:17 +02:00
|
|
|
document.getElementById('scanModal').addEventListener('show.bs.modal', e => {
|
|
|
|
const { index } = e.relatedTarget.dataset;
|
|
|
|
$input = index ? document.querySelector(`[name="Outputs[${index}].DestinationAddress"]`) : null;
|
|
|
|
});
|
2020-03-26 11:59:28 +01:00
|
|
|
});
|