Fix deleting last target (#7)

* fix deleting last target
This commit is contained in:
Tiago Vasconcelos 2023-09-26 12:43:51 +01:00 committed by GitHub
commit a2efae3c30
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
4 changed files with 13 additions and 9 deletions

View file

@ -34,8 +34,10 @@ new Vue({
},
methods: {
clearTarget(index) {
if(this.targets.length == 1) {
return this.deleteTargets()
}
this.targets.splice(index, 1)
console.log(this.targets)
this.$q.notify({
message: 'Removed item. You must click to save manually.',
timeout: 500
@ -84,7 +86,7 @@ new Vue({
},
deleteTargets() {
LNbits.utils
.confirmDialog('Are you sure you want to delete the targets?')
.confirmDialog('Are you sure you want to delete all targets?')
.onOk(() => {
this.targets = []
LNbits.api