mirror of
https://github.com/lnbits/lnbits-legend.git
synced 2025-03-15 20:30:28 +01:00
Cashu: fix UI bugs (#1450)
This commit is contained in:
parent
7968c495ea
commit
661fc6c625
1 changed files with 9 additions and 37 deletions
|
@ -1701,7 +1701,7 @@ page_container %}
|
||||||
outputs
|
outputs
|
||||||
}
|
}
|
||||||
)
|
)
|
||||||
this.assertMintError(promises.data)
|
this.assertMintError(promises.data, false)
|
||||||
if (promises.data.promises == null) {
|
if (promises.data.promises == null) {
|
||||||
return {}
|
return {}
|
||||||
}
|
}
|
||||||
|
@ -1733,13 +1733,12 @@ page_container %}
|
||||||
|
|
||||||
// update UI
|
// update UI
|
||||||
await this.setInvoicePaid(payment_hash)
|
await this.setInvoicePaid(payment_hash)
|
||||||
tokensBase64 = btoa(JSON.stringify(proofs))
|
|
||||||
|
|
||||||
this.historyTokens.push({
|
this.historyTokens.push({
|
||||||
status: 'paid',
|
status: 'paid',
|
||||||
amount: amount,
|
amount: amount,
|
||||||
date: currentDateStr(),
|
date: currentDateStr(),
|
||||||
token: tokensBase64
|
token: this.serializeProofs(proofs)
|
||||||
})
|
})
|
||||||
this.storehistoryTokens()
|
this.storehistoryTokens()
|
||||||
|
|
||||||
|
@ -1932,19 +1931,6 @@ page_container %}
|
||||||
|
|
||||||
if (window.navigator.vibrate) navigator.vibrate(200)
|
if (window.navigator.vibrate) navigator.vibrate(200)
|
||||||
this.notifySuccess('Tokens received.')
|
this.notifySuccess('Tokens received.')
|
||||||
// this.$q.notify({
|
|
||||||
// timeout: 5000,
|
|
||||||
// type: 'positive',
|
|
||||||
// message: 'Tokens received',
|
|
||||||
// position: 'top',
|
|
||||||
// actions: [
|
|
||||||
// {
|
|
||||||
// icon: 'close',
|
|
||||||
// color: 'white',
|
|
||||||
// handler: () => {}
|
|
||||||
// }
|
|
||||||
// ]
|
|
||||||
// })
|
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
console.error(error)
|
console.error(error)
|
||||||
LNbits.utils.notifyApiError(error)
|
LNbits.utils.notifyApiError(error)
|
||||||
|
@ -2018,31 +2004,17 @@ page_container %}
|
||||||
this.assertMintError(data)
|
this.assertMintError(data)
|
||||||
if (window.navigator.vibrate) navigator.vibrate(200)
|
if (window.navigator.vibrate) navigator.vibrate(200)
|
||||||
this.notifySuccess('Token paid.')
|
this.notifySuccess('Token paid.')
|
||||||
// this.$q.notify({
|
|
||||||
// timeout: 5000,
|
|
||||||
// type: 'positive',
|
|
||||||
// message: 'Invoice paid',
|
|
||||||
// position: 'top',
|
|
||||||
// actions: [
|
|
||||||
// {
|
|
||||||
// icon: 'close',
|
|
||||||
// color: 'white',
|
|
||||||
// handler: () => {}
|
|
||||||
// }
|
|
||||||
// ]
|
|
||||||
// })
|
|
||||||
// delete spent tokens from db
|
// delete spent tokens from db
|
||||||
this.deleteProofs(scndProofs)
|
this.deleteProofs(scndProofs)
|
||||||
|
|
||||||
// update UI
|
// update UI
|
||||||
|
|
||||||
tokensBase64 = btoa(JSON.stringify(scndProofs))
|
|
||||||
|
|
||||||
this.historyTokens.push({
|
this.historyTokens.push({
|
||||||
status: 'paid',
|
status: 'paid',
|
||||||
amount: -amount,
|
amount: -amount,
|
||||||
date: currentDateStr(),
|
date: currentDateStr(),
|
||||||
token: tokensBase64
|
token: this.serializeProofs(scndProofs)
|
||||||
})
|
})
|
||||||
this.storehistoryTokens()
|
this.storehistoryTokens()
|
||||||
|
|
||||||
|
@ -2102,13 +2074,11 @@ page_container %}
|
||||||
|
|
||||||
// update UI
|
// update UI
|
||||||
if (update_history) {
|
if (update_history) {
|
||||||
tokensBase64 = btoa(JSON.stringify(spentProofs))
|
|
||||||
|
|
||||||
this.historyTokens.push({
|
this.historyTokens.push({
|
||||||
status: 'paid',
|
status: 'paid',
|
||||||
amount: -this.sumProofs(spentProofs),
|
amount: -this.sumProofs(spentProofs),
|
||||||
date: currentDateStr(),
|
date: currentDateStr(),
|
||||||
token: tokensBase64
|
token: this.serializeProofs(spentProofs)
|
||||||
})
|
})
|
||||||
this.storehistoryTokens()
|
this.storehistoryTokens()
|
||||||
}
|
}
|
||||||
|
@ -2376,9 +2346,11 @@ page_container %}
|
||||||
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
|
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
|
||||||
|
|
||||||
////////////// UI HELPERS /////////////
|
////////////// UI HELPERS /////////////
|
||||||
assertMintError: function (response) {
|
assertMintError: function (response, verbose = true) {
|
||||||
if (response.error != null) {
|
if (response.error != null) {
|
||||||
this.notifyError(`Mint error: ${response.error}`)
|
if (verbose) {
|
||||||
|
this.notifyError(`Mint error: ${response.error}`)
|
||||||
|
}
|
||||||
throw new Error(`Mint error: ${response.error}`)
|
throw new Error(`Mint error: ${response.error}`)
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
Loading…
Add table
Reference in a new issue