fix: deleting the wallet did not update lastActiveWallet (#3628)
This commit is contained in:
parent
89d673448a
commit
71e0b396d2
4 changed files with 9 additions and 8 deletions
2
lnbits/static/bundle-components.min.js
vendored
2
lnbits/static/bundle-components.min.js
vendored
File diff suppressed because one or more lines are too long
2
lnbits/static/bundle.min.js
vendored
2
lnbits/static/bundle.min.js
vendored
File diff suppressed because one or more lines are too long
|
|
@ -151,11 +151,7 @@ window._lnbitsApi = {
|
||||||
)
|
)
|
||||||
},
|
},
|
||||||
deleteWallet(wallet) {
|
deleteWallet(wallet) {
|
||||||
return this.request('delete', `/api/v1/wallet/${wallet.id}`).then(_ => {
|
return this.request('delete', `/api/v1/wallet/${wallet.id}`)
|
||||||
let url = new URL(window.location.href)
|
|
||||||
url.searchParams.delete('wal')
|
|
||||||
window.location = url
|
|
||||||
})
|
|
||||||
},
|
},
|
||||||
getPayments(wallet, params) {
|
getPayments(wallet, params) {
|
||||||
return this.request(
|
return this.request(
|
||||||
|
|
|
||||||
|
|
@ -29,7 +29,12 @@ window.app.component('lnbits-wallet-extra', {
|
||||||
.onOk(() => {
|
.onOk(() => {
|
||||||
LNbits.api
|
LNbits.api
|
||||||
.deleteWallet(this.g.wallet)
|
.deleteWallet(this.g.wallet)
|
||||||
.then(_ => {
|
.then(() => {
|
||||||
|
this.g.user.wallets = this.g.user.wallets.filter(
|
||||||
|
w => w.id !== this.g.wallet.id
|
||||||
|
)
|
||||||
|
this.g.lastActiveWallet = this.g.user.wallets[0].id
|
||||||
|
this.$router.push(`/wallet/${this.g.lastActiveWallet}`)
|
||||||
Quasar.Notify.create({
|
Quasar.Notify.create({
|
||||||
timeout: 3000,
|
timeout: 3000,
|
||||||
message: `Wallet deleted!`,
|
message: `Wallet deleted!`,
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue