File tree Expand file tree Collapse file tree
api/src/main/java/com/getcode/network
app/src/main/java/com/getcode/view/main/home Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -94,9 +94,7 @@ class HistoryController @Inject constructor(
9494
9595 _chats .value = updatedWithMessages.sortedByDescending { it.lastMessageMillis }
9696
97- pagerMap.entries.onEach { (id, pagingSource) ->
98- pagingSource.invalidate()
99- }
97+ pagerMap.clear()
10098 }
10199
102100 suspend fun advanceReadPointer (chatId : ID ) {
Original file line number Diff line number Diff line change @@ -185,7 +185,6 @@ suspend fun Client.receiveRemoteSuspend(giftCard: GiftCardAccount): KinAmount =
185185 )
186186
187187 balanceController.fetchBalanceSuspend()
188- // TODO: fetch chats here somehow?
189188
190189 return @withContext kinAmount
191190 }
Original file line number Diff line number Diff line change @@ -25,10 +25,6 @@ import javax.inject.Inject
2525import kotlin.coroutines.resume
2626import kotlin.coroutines.resumeWithException
2727
28- data class Request (
29- val amount : KinAmount ,
30- val payload : CodePayload ,
31- )
3228
3329class PaymentRepository @Inject constructor(
3430 @ApplicationContext private val context : Context ,
Original file line number Diff line number Diff line change @@ -343,9 +343,11 @@ class HomeViewModel @Inject constructor(
343343 )
344344 }
345345 .subscribe({
346- cancelSend(PresentationStyle .Pop )
347- vibrator.vibrate()
348- viewModelScope.launch { historyController.fetchChats() }
346+ viewModelScope.launch {
347+ cancelSend(PresentationStyle .Pop )
348+ vibrator.vibrate()
349+ historyController.fetchChats()
350+ }
349351 }, {
350352 ErrorUtils .handleError(it)
351353 cancelSend(style = PresentationStyle .Slide )
@@ -671,6 +673,8 @@ class HomeViewModel @Inject constructor(
671673 paymentConfirmation.payload.rendezvous
672674 )
673675 }.onSuccess {
676+ historyController.fetchChats()
677+
674678 showToast(paymentConfirmation.localAmount, false )
675679
676680 withContext(Dispatchers .Main ) {
@@ -1128,6 +1132,9 @@ class HomeViewModel @Inject constructor(
11281132 )
11291133 analytics.cashLinkGrab(amount.kin, amount.rate.currency)
11301134 analytics.onBillReceived()
1135+
1136+ historyController.fetchChats()
1137+
11311138 viewModelScope.launch(Dispatchers .Main ) {
11321139 BottomBarManager .clear()
11331140 showBill(
You can’t perform that action at this time.
0 commit comments