fix: cleanup paymentEvents, simplify websockets (#3570)

This commit is contained in:
dni ⚡
2025-11-26 13:11:27 +01:00
committed by GitHub
parent 7f114ddcc0
commit baa9a35773
6 changed files with 50 additions and 57 deletions
-12
View File
@@ -2,18 +2,6 @@ window.LNbits = {
g: window.g,
utils: window._lnbitsUtils,
api: window._lnbitsApi,
events: {
onInvoicePaid(wallet, cb) {
ws = new WebSocket(`${websocketUrl}/${wallet.inkey}`)
ws.onmessage = ev => {
const data = JSON.parse(ev.data)
if (data.payment) {
cb(data)
}
}
return ws.onclose
}
},
map: {
user(data) {
const obj = {