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,43 +169,48 @@
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)
'/jukebox/api/v1/jukebox/jb/invoicep/' + if (res.data.paid == true) {
self.receive.id +
'/{{ juke_id }}/' +
self.receive.paymentHash
)
console.log(res.data)
console.log(self.receive.id)
if (res.data[2] == self.receive.id) {
clearInterval(dialog.paymentChecker) clearInterval(dialog.paymentChecker)
dialog.dismissMsg() LNbits.api
self.receive.dialogues.second = false .request(
'GET',
'/jukebox/api/v1/jukebox/jb/invoicep/' +
self.receive.id +
'/{{ juke_id }}/' +
self.receive.paymentHash
)
.then(function (ress) {
console.log(ress)
if (ress.data[2] == self.receive.id) {
clearInterval(dialog.paymentChecker)
dialog.dismissMsg()
self.receive.dialogues.second = false
self.$q.notify({ self.$q.notify({
type: 'positive', type: 'positive',
message: message:
'Success! "' + 'Success! "' +
self.receive.name + self.receive.name +
'" will be played soon', '" will be played soon',
timeout: 3000 timeout: 3000
}) })
self.receive.dialogues.first = false self.receive.dialogues.first = false
}
})
} }
}) })
}, 3000) }, 3000)
})
.finally(
setTimeout(() => { setTimeout(() => {
self.getCurrent() self.getCurrent()
}, 500) }, 500)
) })
.catch(err => { .catch(err => {
self.$q.notify({ self.$q.notify({
color: 'warning', color: 'warning',