Fixed multiple play bug in jukebox

This commit is contained in:
Ben Arc 2021-08-16 09:39:14 +01:00
parent 52cb381bd5
commit ee9490ab68

View File

@ -169,21 +169,25 @@
LNbits.api LNbits.api
.request( .request(
'GET', 'GET',
'/jukebox/api/v1/jukebox/jb/invoicep/' + '/jukebox/api/v1/jukebox/jb/checkinvoice/' +
self.receive.id + self.receive.paymentHash +
'/{{ juke_id }}/' + '/{{ juke_id }}'
self.receive.paymentHash
) )
.then(function (res) { .then(function (res) {
console.log( console.log(res)
if (res.data.paid == true) {
clearInterval(dialog.paymentChecker)
LNbits.api
.request(
'GET',
'/jukebox/api/v1/jukebox/jb/invoicep/' + '/jukebox/api/v1/jukebox/jb/invoicep/' +
self.receive.id + self.receive.id +
'/{{ juke_id }}/' + '/{{ juke_id }}/' +
self.receive.paymentHash self.receive.paymentHash
) )
console.log(res.data) .then(function (ress) {
console.log(self.receive.id) console.log(ress)
if (res.data[2] == self.receive.id) { if (ress.data[2] == self.receive.id) {
clearInterval(dialog.paymentChecker) clearInterval(dialog.paymentChecker)
dialog.dismissMsg() dialog.dismissMsg()
self.receive.dialogues.second = false self.receive.dialogues.second = false
@ -199,13 +203,14 @@
self.receive.dialogues.first = false self.receive.dialogues.first = false
} }
}) })
}, 3000) }
}) })
.finally( }, 3000)
setTimeout(() => { setTimeout(() => {
self.getCurrent() self.getCurrent()
}, 500) }, 500)
) })
.catch(err => { .catch(err => {
self.$q.notify({ self.$q.notify({
color: 'warning', color: 'warning',