fix: cleanup paymentEvents, simplify websockets (#3570)
This commit is contained in:
@@ -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 = {
|
||||
|
||||
Reference in New Issue
Block a user