mirror of
https://github.com/vitorpamplona/amethyst.git
synced 2026-08-11 08:47:33 +00:00
fix(nutzap): orange highlight on the lightning bolt for cashu zaps
The reaction-row icon turns orange when the logged-in user has
zapped a note. Phase 1 extended Note.isZappedBy to detect cashu
zaps, but ObserveZapIconState had a fast-path gate that skipped
the whole calculation when the note had no LN zap data:
val hasZapData =
zapsState?.note?.zapPayments?.isNotEmpty() == true ||
zapsState?.note?.zaps?.isNotEmpty() == true
A cashu-only zap leaves both `zaps` and `zapPayments` empty, so
hasZapData was false, wasZapped was hard-coded false, and the
new isZappedBy logic never ran. The amount counter still updated
because that path (Note.zapsAmount) was already extended in
Phase 1 — only the icon gate was missing the third source.
Add `nutzaps?.isNotEmpty()` to the gate.
This commit is contained in:
@@ -1457,7 +1457,8 @@ fun ObserveZapIconState(
|
||||
LaunchedEffect(key1 = zapsState, key2 = hasPendingPaymentRequest) {
|
||||
val hasZapData =
|
||||
zapsState?.note?.zapPayments?.isNotEmpty() == true ||
|
||||
zapsState?.note?.zaps?.isNotEmpty() == true
|
||||
zapsState?.note?.zaps?.isNotEmpty() == true ||
|
||||
zapsState?.note?.nutzaps?.isNotEmpty() == true
|
||||
val wasZapped =
|
||||
if (hasZapData) {
|
||||
accountViewModel.calculateIfNoteWasZappedByAccount(baseNote, afterTimeInSeconds)
|
||||
|
||||
Reference in New Issue
Block a user