From 8cc2d779644c62a397afab9d104565f90bc58fb7 Mon Sep 17 00:00:00 2001 From: Benoit Marty Date: Mon, 26 Jan 2026 18:23:32 +0100 Subject: [PATCH] Fix issues detected by Paparazzi --- .../components/reactionsummary/ReactionSummaryView.kt | 6 ++++-- .../impl/developer/DeveloperSettingsStateProvider.kt | 7 ++++++- .../mediaviewer/impl/local/player/ExoPlayerForPreview.kt | 4 +++- 3 files changed, 13 insertions(+), 4 deletions(-) diff --git a/features/messages/impl/src/main/kotlin/io/element/android/features/messages/impl/timeline/components/reactionsummary/ReactionSummaryView.kt b/features/messages/impl/src/main/kotlin/io/element/android/features/messages/impl/timeline/components/reactionsummary/ReactionSummaryView.kt index c138378a3a..03ce564eff 100644 --- a/features/messages/impl/src/main/kotlin/io/element/android/features/messages/impl/timeline/components/reactionsummary/ReactionSummaryView.kt +++ b/features/messages/impl/src/main/kotlin/io/element/android/features/messages/impl/timeline/components/reactionsummary/ReactionSummaryView.kt @@ -114,8 +114,10 @@ private fun ReactionSummaryViewContent( LaunchedEffect(pagerState.currentPage) { selectedReactionKey = summary.reactions[pagerState.currentPage].key val visibleInfo = reactionListState.layoutInfo.visibleItemsInfo - if (selectedReactionIndex <= visibleInfo.first().index || selectedReactionIndex >= visibleInfo.last().index) { - reactionListState.animateScrollToItem(selectedReactionIndex) + if (visibleInfo.isNotEmpty()) { + if (selectedReactionIndex <= visibleInfo.first().index || selectedReactionIndex >= visibleInfo.last().index) { + reactionListState.animateScrollToItem(selectedReactionIndex) + } } } diff --git a/features/preferences/impl/src/main/kotlin/io/element/android/features/preferences/impl/developer/DeveloperSettingsStateProvider.kt b/features/preferences/impl/src/main/kotlin/io/element/android/features/preferences/impl/developer/DeveloperSettingsStateProvider.kt index 9ac4fdfcc8..b925eabe9e 100644 --- a/features/preferences/impl/src/main/kotlin/io/element/android/features/preferences/impl/developer/DeveloperSettingsStateProvider.kt +++ b/features/preferences/impl/src/main/kotlin/io/element/android/features/preferences/impl/developer/DeveloperSettingsStateProvider.kt @@ -32,7 +32,12 @@ open class DeveloperSettingsStateProvider : PreviewParameterProvider