lnbits / withdraw

LNbits Withdraw Extension
MIT License
6 stars 9 forks source link

Fix: Add check if no uses left and uses needs to be incremented #39

Closed LoadJulz closed 2 months ago

LoadJulz commented 2 months ago

Fixes: https://github.com/lnbits/withdraw/issues/38

We need to check if usescsv is empty. If all uses were consumed, usescsv is just an empty string. In this case, we need to handle it differently. We need to set current_numbers to the last value of uses and also update usescsv accordingly.

If we don't handle this behavior, it won't be possible to update an already used withdraw link to reuse it again.