Refactors lightning account naming

Standardizes lightning account name to "Assets:Bitcoin:Lightning" for consistency.

Updates the database and code to reflect this change, ensuring that payment processing and account management use the new name.
Prevents polling of receivable dialog after settlement.
This commit is contained in:
padreug 2025-10-23 04:10:06 +02:00
parent 8a961e1331
commit 49f21da55a
3 changed files with 61 additions and 31 deletions

View file

@ -958,10 +958,14 @@ window.app = Vue.createApp({
)
if (response.data && response.data.paid) {
// Stop polling immediately
clearInterval(this.settleReceivableDialog.pollIntervalId)
this.settleReceivableDialog.pollIntervalId = null
// Record payment in accounting - this creates the journal entry
// that settles the receivable
try {
await LNbits.api.request(
const recordResponse = await LNbits.api.request(
'POST',
'/castle/api/v1/record-payment',
this.g.user.wallets[0].adminkey,
@ -969,21 +973,27 @@ window.app = Vue.createApp({
payment_hash: paymentHash
}
)
console.log('Settlement payment recorded:', recordResponse.data)
this.$q.notify({
type: 'positive',
message: 'Payment received! Receivable has been settled.',
timeout: 3000
})
// Close dialog and refresh
this.settleReceivableDialog.show = false
await this.loadBalance()
await this.loadTransactions()
await this.loadAllUserBalances()
} catch (error) {
console.error('Error recording settlement payment:', error)
this.$q.notify({
type: 'negative',
message: 'Payment detected but failed to record: ' + (error.response?.data?.detail || error.message),
timeout: 5000
})
}
this.$q.notify({
type: 'positive',
message: 'Payment received! Receivable has been settled.',
timeout: 3000
})
// Close dialog and refresh
this.settleReceivableDialog.show = false
await this.loadBalance()
await this.loadTransactions()
await this.loadAllUserBalances()
return true
}
return false