fix blocking loading button on checkout

This commit is contained in:
Tiago Vasconcelos 2023-03-17 10:13:35 +00:00
parent 0f5c3e32d0
commit 93df7bb2c0

View file

@ -38,6 +38,7 @@ async function customerStall(path) {
data: { data: {
payment_request: null payment_request: null
}, },
dismissMsg: null,
show: false show: false
}, },
downloadOrderDialog: { downloadOrderDialog: {
@ -181,6 +182,7 @@ async function customerStall(path) {
this.checkoutDialog.show = true this.checkoutDialog.show = true
}, },
resetCheckout() { resetCheckout() {
this.loading = false
this.checkoutDialog = { this.checkoutDialog = {
show: false, show: false,
data: { data: {
@ -190,6 +192,7 @@ async function customerStall(path) {
}, },
closeQrCodeDialog() { closeQrCodeDialog() {
this.qrCodeDialog.show = false this.qrCodeDialog.show = false
this.qrCodeDialog.dismissMsg = null
}, },
async placeOrder() { async placeOrder() {
this.loading = true this.loading = true
@ -319,7 +322,7 @@ async function customerStall(path) {
this.messageFilter(plaintext, cb => Promise.resolve(pool.close)) this.messageFilter(plaintext, cb => Promise.resolve(pool.close))
} catch { } catch {
console.error('Unable to decrypt message!') console.debug('Unable to decrypt message! Probably not for us!')
} }
}) })
} catch (err) { } catch (err) {
@ -331,9 +334,8 @@ async function customerStall(path) {
let json = JSON.parse(text) let json = JSON.parse(text)
if (json.id != this.activeOrder) return if (json.id != this.activeOrder) return
if (json.payment_options) { if (json.payment_options) {
let payment_request = json.payment_options.find( let payment_request = json.payment_options.find(o => o.type == 'ln')
o => o.type == 'ln' .link
).link
if (!payment_request) return if (!payment_request) return
this.loading = false this.loading = false
this.qrCodeDialog.data.payment_request = payment_request this.qrCodeDialog.data.payment_request = payment_request