Skip to content

Commit

Permalink
Sort last txs on the Home Page reversely (#1061)
Browse files Browse the repository at this point in the history
  • Loading branch information
igordanilcenko authored Mar 1, 2024
1 parent 3d7fc02 commit 19c266f
Showing 1 changed file with 2 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,7 @@ class HomeFragmentViewModel : CommonViewModel() {

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

fun processItemClick(item: CommonViewHolderItem) {
Expand Down Expand Up @@ -328,6 +328,6 @@ class HomeFragmentViewModel : CommonViewModel() {
}

companion object {
val amountOfTransactions = 2
private const val TRANSACTION_AMOUNT_HOME_PAGE = 2
}
}

0 comments on commit 19c266f

Please sign in to comment.