From 84370e71e992785cc1315eca2306dde319c72de4 Mon Sep 17 00:00:00 2001 From: dankito Date: Thu, 5 Sep 2024 23:04:14 +0200 Subject: [PATCH] Implemented setting User.displayIndex --- .../kotlin/net/codinux/banking/ui/service/BankingService.kt | 2 ++ 1 file changed, 2 insertions(+) diff --git a/composeApp/src/commonMain/kotlin/net/codinux/banking/ui/service/BankingService.kt b/composeApp/src/commonMain/kotlin/net/codinux/banking/ui/service/BankingService.kt index c8adf17..f9c698c 100644 --- a/composeApp/src/commonMain/kotlin/net/codinux/banking/ui/service/BankingService.kt +++ b/composeApp/src/commonMain/kotlin/net/codinux/banking/ui/service/BankingService.kt @@ -92,6 +92,8 @@ class BankingService( private suspend fun handleSuccessfulGetAccountDataResponse(response: GetAccountDataResponse) { try { val newUser = response.user + newUser.displayIndex = uiState.userAccounts.value.size + val newUserEntity = bankingRepository.persistUserAccount(newUser) log.info { "Saved user account $newUserEntity with ${newUserEntity.accounts.flatMap { it.bookedTransactionsEntities }.size} transactions" }