From 148e306b623c7eec5efff3d629ea7ebe561fb4ea Mon Sep 17 00:00:00 2001 From: Vincent TE Date: Tue, 25 Feb 2025 08:30:49 +0100 Subject: [PATCH] fix: Avoid blink of the empty state when we back from a transfer on phones --- .../ui/screen/main/transfers/TransfersScreenWrapper.kt | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/app/src/main/java/com/infomaniak/swisstransfer/ui/screen/main/transfers/TransfersScreenWrapper.kt b/app/src/main/java/com/infomaniak/swisstransfer/ui/screen/main/transfers/TransfersScreenWrapper.kt index 3f0e57998..bdd96dfd5 100644 --- a/app/src/main/java/com/infomaniak/swisstransfer/ui/screen/main/transfers/TransfersScreenWrapper.kt +++ b/app/src/main/java/com/infomaniak/swisstransfer/ui/screen/main/transfers/TransfersScreenWrapper.kt @@ -163,7 +163,11 @@ private fun DetailPane( navigator: ThreePaneScaffoldNavigator, hasTransfer: () -> Boolean, ) { - when (val destinationContent = navigator.currentDestination?.content) { + val windowAdaptiveInfo = LocalWindowAdaptiveInfo.current + val isWindowLarge = windowAdaptiveInfo.isWindowLarge() + val destinationContent = if (isWindowLarge) navigator.currentDestination?.content else navigator.safeCurrentContent() + + when (destinationContent) { null -> { NoSelectionEmptyState(hasTransfer()) }