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

@ -1,4 +1,5 @@
# Split Payments - <small>[LNbits](https://github.com/lnbits/lnbits) extension</small>
<small>For more about LNBits extension check [this tutorial](https://github.com/lnbits/lnbits/wiki/LNbits-Documentation#use-cases-of-lnbits)</small>
## Have payments split between multiple wallets
@ -39,7 +40,6 @@ IMPORTANT:
<img width="1148" alt="Bildschirm­foto 2023-05-01 um 22 14 36" src="https://user-images.githubusercontent.com/63317640/235534056-49296aeb-7295-4b4e-9f57-914a677f5ad4.png">
<img width="1402" alt="Bildschirm­foto 2023-05-01 um 22 17 52" src="https://user-images.githubusercontent.com/63317640/235534063-b2734654-7c1a-48a3-b48e-32798c232b49.png">
## Sponsored by
[![](https://cdn.shopify.com/s/files/1/0826/9235/files/cryptograffiti_logo_clear_background.png?v=1504730421)](https://cryptograffiti.com/)

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

View file

@ -9,7 +9,7 @@ from loguru import logger
from lnbits import bolt11
from lnbits.core.crud import get_standalone_payment
from lnbits.core.models import Payment
from lnbits.core.services import create_invoice, pay_invoice, fee_reserve
from lnbits.core.services import create_invoice, fee_reserve, pay_invoice
from lnbits.helpers import get_current_extension_name
from lnbits.tasks import register_invoice_listener

View file

@ -118,10 +118,12 @@
This is valid for every payment, doesn't matter how it was created.
</p>
<p>
Targets can be LNBits wallets from this LNBits instance or any valid LNURL or LN Address.
Targets can be LNBits wallets from this LNBits instance or any valid
LNURL or LN Address.
</p>
<p class="text-warning">
LNURLp and LN Addresses must allow comments > 100 chars and also have a flexible amount.
LNURLp and LN Addresses must allow comments > 100 chars and also
have a flexible amount.
</p>
<p>
To remove a wallet from the targets list just press the X and save.