chore: here and there

This commit is contained in:
Vlad Stan
2022-10-10 14:22:00 +03:00
parent 07eea85677
commit 7f20755c5a

View File

@@ -94,6 +94,12 @@ page_container %}
Recheck Recheck
</q-badge> </q-badge>
</div> </div>
<div v-if="props.row.status === 'paid'">
<q-icon
name="call_received"
color="green"
>
</div>
</q-td> </q-td>
<q-td <q-td
key="amount" key="amount"
@@ -844,7 +850,7 @@ page_container %}
}, },
showInvoiceDialog: async function (data) { showInvoiceDialog: async function (data) {
this.buyData = data this.buyData = _.clone(data)
this.showInvoiceDetails = true this.showInvoiceDetails = true
}, },
@@ -859,7 +865,7 @@ page_container %}
this.buyData.bolt11 = data.pr this.buyData.bolt11 = data.pr
this.buyData.hash = data.hash this.buyData.hash = data.hash
this.buyOrders.push({ this.buyOrders.push({
...this.buyData, ..._.clone(this.buyData),
date: currentDateStr(), date: currentDateStr(),
status: 'pending' status: 'pending'
}) })
@@ -894,8 +900,9 @@ page_container %}
}, },
recheckBuyOrder: async function (hash) { recheckBuyOrder: async function (hash) {
console.log('### recheckBuyOrder', hash) console.log('### recheckBuyOrder.hash', hash)
const tokens = this.tokens.find(bt => (bt.hash = hash)) const tokens = this.tokens.find(bt => (bt.hash === hash))
console.log('### recheckBuyOrder.tokens', tokens)
if (!tokens) { if (!tokens) {
console.error('####### no token for hash', hash) console.error('####### no token for hash', hash)
return return
@@ -906,6 +913,12 @@ page_container %}
) )
if (promises && promises.length) { if (promises && promises.length) {
tokens.promises = promises tokens.promises = promises
tokens.status = 'paid'
this.storeTokens()
const buyOrder = this.buyOrders.find(bo => bo.hash === hash)
buyOrder.status = 'paid'
this.storeBuyOrders()
} }
}, },
@@ -1043,7 +1056,8 @@ page_container %}
localStorage.getItem('cashu.buyOrders') || '[]' localStorage.getItem('cashu.buyOrders') || '[]'
) )
this.tokens = JSON.parse(localStorage.getItem('cashu.tokens') || '[]') this.tokens = JSON.parse(localStorage.getItem('cashu.tokens') || '[]')
console.log('#### this.buyOrders', this.buyOrders) console.table(this.buyOrders)
console.table(this.tokens)
console.log('#### this.mintId', this.mintId) console.log('#### this.mintId', this.mintId)
console.log('#### this.mintName', this.mintName) console.log('#### this.mintName', this.mintName)