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

View File

@ -1142,10 +1142,12 @@ fun ObserveZapAmountText(
if (zapsState?.note?.zapPayments?.isNotEmpty() == true) {
val zapAmountTxt by
produceState(initialValue = showAmount(baseNote.zapsAmount), key1 = baseNote) {
accountViewModel.calculateZapAmount(baseNote) { newZapAmount ->
if (value != newZapAmount) {
value = newZapAmount
produceState(initialValue = showAmount(baseNote.zapsAmount), key1 = zapsState) {
zapsState?.note?.let {
accountViewModel.calculateZapAmount(it) { newZapAmount ->
if (value != newZapAmount) {
value = newZapAmount
}
}
}
}