allow wallet rename issue #141

This commit is contained in:
Tiago vasconcelos
2021-08-06 12:37:30 -03:00
committed by fiatjaf
parent 16f8071731
commit b3856d5aff
4 changed files with 76 additions and 3 deletions
+24 -1
View File
@@ -184,7 +184,8 @@ new Vue({
show: false,
location: window.location
},
balance: 0
balance: 0,
newName: ''
}
},
computed: {
@@ -583,6 +584,28 @@ new Vue({
}
})
},
updateWalletName: function(){
let newName = this.newName
if(!newName || !newName.length) return
// let data = {name: newName}
LNbits.api
.request(
'PUT',
'/api/v1/wallet/' + newName,
this.g.wallet.inkey,
{}
).then(res => {
this.newName = ''
this.$q.notify({
message: `Wallet named updated.`,
type: 'positive',
timeout: 3500
})
}).catch(err => {
this.newName = ''
LNbits.utils.notifyApiError(err)
})
},
deleteWallet: function (walletId, user) {
LNbits.utils
.confirmDialog('Are you sure you want to delete this wallet?')