From 58b08611f5a8e942150498cc0edbc6aac12d87b4 Mon Sep 17 00:00:00 2001 From: Vincent TE Date: Tue, 26 Nov 2024 17:06:25 +0100 Subject: [PATCH] chore: Use uiState directly --- .../ui/screen/main/transferdetails/TransferDetailsScreen.kt | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/app/src/main/java/com/infomaniak/swisstransfer/ui/screen/main/transferdetails/TransferDetailsScreen.kt b/app/src/main/java/com/infomaniak/swisstransfer/ui/screen/main/transferdetails/TransferDetailsScreen.kt index 8c35f536d..95bf6edf9 100644 --- a/app/src/main/java/com/infomaniak/swisstransfer/ui/screen/main/transferdetails/TransferDetailsScreen.kt +++ b/app/src/main/java/com/infomaniak/swisstransfer/ui/screen/main/transferdetails/TransferDetailsScreen.kt @@ -65,16 +65,14 @@ fun TransferDetailsScreen( transferDetailsViewModel: TransferDetailsViewModel = hiltViewModel(), ) { val uiState by transferDetailsViewModel.uiState.collectAsStateWithLifecycle() - val isLoading by remember { derivedStateOf { uiState is Loading } } - val isDelete by remember { derivedStateOf { uiState is Delete } } LaunchedEffect(transferUuid) { transferDetailsViewModel.loadTransfer(transferUuid) } - if (isDelete) { + if (uiState is Delete) { navigateBack?.invoke() - } else if (!isLoading) { + } else if (uiState is Success) { TransferDetailsScreen( transferUrl = transferDetailsViewModel.getTransferUrl(transferUuid), direction = direction,