Updated on 2026-08-14

This commit is contained in:
Tangem 2025-10-24 14:45:20 +04:00
parent 080592f9c7
commit 468843f7b9
9 changed files with 54 additions and 123 deletions

View file

@ -106,7 +106,7 @@ internal class TesterAccountsViewModel @Inject constructor(
AccountsUM.Button(title = "Fetch accounts", onClick = ::fetchAccounts),
AccountsUM.Button(title = "Fill out the list (up to 20)", onClick = ::fillOutAccountList),
AccountsUM.Button(title = "Archive all", onClick = ::archiveAllAccounts),
// AccountsUM.Button(title = "Sort by derivation index", onClick = ::sortAccountsByIndex),
AccountsUM.Button(title = "Sort by derivation index", onClick = ::sortAccountsByIndex),
AccountsUM.Button(title = "Clear ETag") { clearETag() },
),
)
@ -217,7 +217,7 @@ internal class TesterAccountsViewModel @Inject constructor(
withContext(dispatchers.default) {
val updatedAccountList = AccountList.invoke(
userWalletId = accountList.userWalletId,
accounts = setOf(accountList.mainAccount),
accounts = listOf(accountList.mainAccount),
totalAccounts = accountList.totalAccounts,
sortType = accountList.sortType,
groupType = accountList.groupType,
@ -231,7 +231,6 @@ internal class TesterAccountsViewModel @Inject constructor(
}
}
@Suppress("UnusedPrivateMember")
private fun sortAccountsByIndex(title: String) {
val userWalletId = getUserWallet()?.walletId ?: return
val accountList = walletAccounts.value[userWalletId] ?: return
@ -244,8 +243,7 @@ internal class TesterAccountsViewModel @Inject constructor(
userWalletId = accountList.userWalletId,
accounts = accountList.accounts
.filterIsInstance<Account.CryptoPortfolio>()
.sortedBy { it.derivationIndex.value }
.toSet(),
.sortedBy { it.derivationIndex.value },
totalAccounts = accountList.totalAccounts,
sortType = accountList.sortType,
groupType = accountList.groupType,