Compare commits
2 commits
8438e9f26d
...
3e5eeaf7a9
| Author | SHA1 | Date | |
|---|---|---|---|
| 3e5eeaf7a9 | |||
| 18304984ce |
1 changed files with 14 additions and 7 deletions
|
|
@ -289,14 +289,21 @@ export class WalletWebSocketService extends BaseService {
|
||||||
this.walletService.addTransaction(payment)
|
this.walletService.addTransaction(payment)
|
||||||
}
|
}
|
||||||
|
|
||||||
// Show toast notification for incoming payments
|
// Toast incoming payments only, and only once settled.
|
||||||
if (payment.amount > 0 && !payment.pending) {
|
//
|
||||||
|
// This guard used to read `!payment.pending`, which is never present in
|
||||||
|
// the payload (a pydantic `@property`; see mapPaymentStatus in
|
||||||
|
// WalletService), so it was always true and an unsettled payment could
|
||||||
|
// announce itself as received. `status` is the real field.
|
||||||
|
//
|
||||||
|
// The old `else` branch toasted outgoing payments but was unreachable,
|
||||||
|
// since the enclosing condition already required `amount > 0`. It is
|
||||||
|
// dropped rather than fixed: a send made from this app is already
|
||||||
|
// confirmed by SendDialog's own toast, so re-announcing it here would
|
||||||
|
// double up.
|
||||||
|
if (payment.amount > 0 && payment.status === 'success') {
|
||||||
const amountSats = Math.abs(payment.amount / 1000)
|
const amountSats = Math.abs(payment.amount / 1000)
|
||||||
if (payment.amount > 0) {
|
|
||||||
this.toast.success(`Received ${amountSats} sats!`)
|
this.toast.success(`Received ${amountSats} sats!`)
|
||||||
} else {
|
|
||||||
this.toast.info(`Sent ${amountSats} sats`)
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue