allow wallet rename issue #141
This commit is contained in:
committed by
fiatjaf
parent
16f8071731
commit
b3856d5aff
@@ -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?')
|
||||
|
||||
Reference in New Issue
Block a user