From 71bbae2f9b30bbf897ec6762a60687fe9f02e508 Mon Sep 17 00:00:00 2001 From: Vitor Pamplona Date: Wed, 6 Aug 2025 13:18:45 -0400 Subject: [PATCH] Simple refactoring --- .../notifications/NotificationSummaryState.kt | 16 ++++++---------- 1 file changed, 6 insertions(+), 10 deletions(-) diff --git a/amethyst/src/main/java/com/vitorpamplona/amethyst/ui/screen/loggedIn/notifications/NotificationSummaryState.kt b/amethyst/src/main/java/com/vitorpamplona/amethyst/ui/screen/loggedIn/notifications/NotificationSummaryState.kt index b22941856..1e17c4c48 100644 --- a/amethyst/src/main/java/com/vitorpamplona/amethyst/ui/screen/loggedIn/notifications/NotificationSummaryState.kt +++ b/amethyst/src/main/java/com/vitorpamplona/amethyst/ui/screen/loggedIn/notifications/NotificationSummaryState.kt @@ -111,12 +111,10 @@ class NotificationSummaryState( takenIntoAccount.add(noteEvent.id) } } else if (noteEvent is LnZapEvent) { - if ( - noteEvent.isTaggedUser(currentUser) - ) { // the user might be sending his own receipts noteEvent.pubKey != currentUser + // the user might be sending his own receipts noteEvent.pubKey != currentUser + if (noteEvent.isTaggedUser(currentUser)) { val netDate = formatDate(noteEvent.createdAt) - zaps[netDate] = - (zaps[netDate] ?: BigDecimal.ZERO) + (noteEvent.amount ?: BigDecimal.ZERO) + zaps[netDate] = (zaps[netDate] ?: BigDecimal.ZERO) + (noteEvent.amount ?: BigDecimal.ZERO) takenIntoAccount.add(noteEvent.id) } } else if (noteEvent is BaseThreadedEvent) { @@ -178,12 +176,10 @@ class NotificationSummaryState( hasNewElements = true } } else if (noteEvent is LnZapEvent) { - if ( - noteEvent.isTaggedUser(currentUser) - ) { // && noteEvent.pubKey != currentUser User might be sending his own receipts + if (noteEvent.isTaggedUser(currentUser)) { + // && noteEvent.pubKey != currentUser User might be sending his own receipts val netDate = formatDate(noteEvent.createdAt) - zaps[netDate] = - (zaps[netDate] ?: BigDecimal.ZERO) + (noteEvent.amount ?: BigDecimal.ZERO) + zaps[netDate] = (zaps[netDate] ?: BigDecimal.ZERO) + (noteEvent.amount ?: BigDecimal.ZERO) takenIntoAccount.add(noteEvent.id) hasNewElements = true }