Skip to content

Commit

Permalink
Sort last txs on the Home Page reversely (#1062)
Browse files Browse the repository at this point in the history
  • Loading branch information
igordanilcenko committed May 14, 2024
1 parent 257eed9 commit ab93188
Showing 1 changed file with 2 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@ class HomeFragmentViewModel : CommonViewModel() {
private val _refreshBalanceInfo = SingleLiveEvent<Boolean>()
val refreshBalanceInfo: SingleLiveEvent<Boolean> = _refreshBalanceInfo

val txList = MediatorLiveData<MutableList<CommonViewHolderItem>>()
val txList = MediatorLiveData<List<CommonViewHolderItem>>()

val emoji = MutableLiveData<String>()

Expand All @@ -106,7 +106,7 @@ class HomeFragmentViewModel : CommonViewModel() {

private fun updateList() {
val list = transactionRepository.list.value ?: return
txList.postValue(list.filterIsInstance<TransactionItem>().sortedByDescending { it.tx.timestamp }.takeLast(TRANSACTION_AMOUNT_HOME_PAGE).toMutableList())
txList.postValue(list.filterIsInstance<TransactionItem>().sortedByDescending { it.tx.timestamp }.take(TRANSACTION_AMOUNT_HOME_PAGE))
}

fun processItemClick(item: CommonViewHolderItem) {
Expand Down

0 comments on commit ab93188

Please sign in to comment.