fix: get balance from websocket instead of separate api call

This commit is contained in:
2026-06-04 12:57:59 +02:00
parent ff50cc1b61
commit 5bdc606d1c
3 changed files with 31 additions and 15 deletions
@@ -81,6 +81,7 @@ class WalletNotificationService : Service() {
* Emitted to [paymentEvents] for in-process UI updates.
*/
data class PaymentEvent(
val walletBalance: Long?,
val amountSats: Long,
val memo: String?,
val isOutgoing: Boolean,
@@ -229,6 +230,7 @@ class WalletNotificationService : Service() {
serviceScope.launch {
_paymentEvents.emit(
PaymentEvent(
walletBalance = msg.walletBalance,
amountSats = amountSats,
memo = payment.memo,
isOutgoing = isOutgoing,
@@ -245,7 +247,7 @@ class WalletNotificationService : Service() {
checkingId = payment.checkingId,
paymentHash = payment.paymentHash,
amountMsat = payment.amount,
feeMsat = 0L, // WsPaymentMessage doesn't carry fee
feeMsat = payment.fee,
memo = payment.memo,
time = payment.time,
status = payment.status,