Fixes lack of zap amount refresh after zapping a note.

This commit is contained in:
Vitor Pamplona
2024-03-20 11:35:03 -04:00
parent 1072b7a5c5
commit d26de39749
@@ -1142,13 +1142,15 @@ fun ObserveZapAmountText(
if (zapsState?.note?.zapPayments?.isNotEmpty() == true) { if (zapsState?.note?.zapPayments?.isNotEmpty() == true) {
val zapAmountTxt by val zapAmountTxt by
produceState(initialValue = showAmount(baseNote.zapsAmount), key1 = baseNote) { produceState(initialValue = showAmount(baseNote.zapsAmount), key1 = zapsState) {
accountViewModel.calculateZapAmount(baseNote) { newZapAmount -> zapsState?.note?.let {
accountViewModel.calculateZapAmount(it) { newZapAmount ->
if (value != newZapAmount) { if (value != newZapAmount) {
value = newZapAmount value = newZapAmount
} }
} }
} }
}
inner(zapAmountTxt) inner(zapAmountTxt)
} else { } else {