Data returned from wallet websocket was not json (#1823)

* Fixed walet websocket json

* format
This commit is contained in:
Arc 2023-07-19 12:14:03 +01:00 committed by GitHub
parent f384c5c366
commit a3aafe4b6f
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 14 additions and 9 deletions

View file

@ -251,10 +251,12 @@ async def pay_invoice(
if wallet:
await websocketUpdater(
wallet_id,
{
"wallet_balance": wallet.balance or None,
"payment": payment._asdict(),
},
json.dumps(
{
"wallet_balance": wallet.balance or None,
"payment": payment._asdict(),
}
),
)
logger.debug(f"payment successful {payment.checking_id}")
elif payment.checking_id is None and payment.ok is False:

View file

@ -1,6 +1,6 @@
// update cache version every time there is a new deployment
// so the service worker reinitializes the cache
const CACHE_VERSION = 48
const CACHE_VERSION = 50
const CURRENT_CACHE = `lnbits-${CACHE_VERSION}-`
const getApiKey = request => {

View file

@ -1,4 +1,5 @@
import asyncio
import json
from typing import Dict, Optional
import httpx
@ -124,10 +125,12 @@ async def wait_for_paid_invoices(invoice_paid_queue: asyncio.Queue):
if wallet:
await websocketUpdater(
payment.wallet_id,
{
"wallet_balance": wallet.balance or None,
"payment": payment.dict(),
},
json.dumps(
{
"wallet_balance": wallet.balance or None,
"payment": payment.dict(),
}
),
)
# dispatch webhook
if payment.webhook and not payment.webhook_status: