fix: frontend withdraw error message (#3282)

This commit is contained in:
dni ⚡ 2025-07-21 09:34:50 +02:00 committed by GitHub
parent dce2bfb440
commit 01fdc1defb
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -274,19 +274,18 @@ window.WalletPageLogic = {
if (!this.receive.lnurl) { if (!this.receive.lnurl) {
this.readNfcTag() this.readNfcTag()
} }
// TODO: lnurl_callback and lnurl_response
// WITHDRAW // WITHDRAW
if (response.data.extra.lnurl_response !== null) { if (response.data.extra.lnurl_response !== null) {
if (response.data.extra.lnurl_response === false) { if (response.data.extra.lnurl_response === false) {
response.data.extra.lnurl_response = `Unable to connect` response.data.extra.lnurl_response = `Unable to connect`
} }
const domain = this.receive.lnurl.callback.split('/')[2]
if (typeof response.data.extra.lnurl_response === 'string') { if (typeof response.data.extra.lnurl_response === 'string') {
// failure // failure
Quasar.Notify.create({ Quasar.Notify.create({
timeout: 5000, timeout: 5000,
type: 'warning', type: 'warning',
message: `${this.receive.lnurl.domain} lnurl-withdraw call failed.`, message: `${domain} lnurl-withdraw call failed.`,
caption: response.data.extra.lnurl_response caption: response.data.extra.lnurl_response
}) })
return return
@ -294,7 +293,7 @@ window.WalletPageLogic = {
// success // success
Quasar.Notify.create({ Quasar.Notify.create({
timeout: 3000, timeout: 3000,
message: `Invoice sent to ${this.receive.lnurl.domain}!`, message: `Invoice sent to ${domain}!`,
spinner: true spinner: true
}) })
} }
@ -350,12 +349,11 @@ window.WalletPageLogic = {
) )
.then(response => { .then(response => {
const data = response.data const data = response.data
if (data.status === 'ERROR') { if (data.status === 'ERROR') {
Quasar.Notify.create({ Quasar.Notify.create({
timeout: 5000, timeout: 5000,
type: 'warning', type: 'warning',
message: `${data.domain} lnurl call failed.`, message: `lnurl scan failed.`,
caption: data.reason caption: data.reason
}) })
return return