diff --git a/strawApp/src/main/kotlin/com/sulkta/straw/feature/channel/ChannelScreen.kt b/strawApp/src/main/kotlin/com/sulkta/straw/feature/channel/ChannelScreen.kt index 3cb44dd45..bca2e6641 100644 --- a/strawApp/src/main/kotlin/com/sulkta/straw/feature/channel/ChannelScreen.kt +++ b/strawApp/src/main/kotlin/com/sulkta/straw/feature/channel/ChannelScreen.kt @@ -88,7 +88,15 @@ fun ChannelScreen( Text("error: ${state.error}", color = MaterialTheme.colorScheme.error) } - else -> LazyColumn( + else -> { + // Hoisted to outer Composable scope — LazyListScope is NOT + // @Composable so collectAsState / remember can't live inside + // the LazyColumn block. + val hideShorts by com.sulkta.straw.data.Settings.get().hideShorts.collectAsState() + val filteredVideos = remember(state.videos, hideShorts) { + com.sulkta.straw.util.applyContentFilters(state.videos, hideShorts = hideShorts) + } + LazyColumn( modifier = Modifier.fillMaxSize().statusBarsPadding(), contentPadding = rememberBottomContentPadding(), ) { @@ -145,10 +153,6 @@ fun ChannelScreen( } HorizontalDivider() } - val hideShorts by com.sulkta.straw.data.Settings.get().hideShorts.collectAsState() - val filteredVideos = remember(state.videos, hideShorts) { - com.sulkta.straw.util.applyContentFilters(state.videos, hideShorts = hideShorts) - } items(filteredVideos) { item -> ChannelVideoRow( item = item, @@ -165,6 +169,7 @@ fun ChannelScreen( HorizontalDivider() } } + } } }