Skip to content

Commit

Permalink
Remove workaround for fixed bug in M3
Browse files Browse the repository at this point in the history
  • Loading branch information
HeroBrine1st committed Jun 17, 2024
1 parent fafe4cc commit 45c5111
Showing 1 changed file with 2 additions and 16 deletions.
18 changes: 2 additions & 16 deletions app/src/main/java/ru/herobrine1st/e621/ui/screen/post/Post.kt
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,6 @@ import androidx.compose.material3.TopAppBarDefaults
import androidx.compose.material3.rememberBottomSheetScaffoldState
import androidx.compose.material3.rememberStandardBottomSheetState
import androidx.compose.runtime.Composable
import androidx.compose.runtime.LaunchedEffect
import androidx.compose.runtime.collectAsState
import androidx.compose.runtime.getValue
import androidx.compose.runtime.remember
Expand Down Expand Up @@ -127,11 +126,8 @@ fun Post(
val loadComments =
preferences.auth != null // Assuming there can't be invalid credentials in preferences
&& (
// TODO automatic download is disabled due to fix below
// https://issuetracker.google.com/issues/299973349
// !preferences.dataSaverModeEnabled // Do not make excessive API calls on user preference
// ||
component.openComments)
!preferences.dataSaverModeEnabled // Do not make excessive API calls on user preference
|| component.openComments)
val comments = component.commentsFlow.collectAsPagingItems(startImmediately = loadComments)

val scrollBehavior = TopAppBarDefaults.pinnedScrollBehavior()
Expand All @@ -144,16 +140,6 @@ fun Post(
skipHiddenState = false
)

LaunchedEffect(
bottomSheetState.currentValue,
comments.loadStates.refresh is LoadState.NotLoading
) {
// Attempt to work https://issuetracker.google.com/issues/299973349 around
if (bottomSheetState.currentValue != SheetValue.Hidden && comments.loadStates.refresh is LoadState.NotLoading) {
bottomSheetState.hide()
}
}

val bottomSheetScaffoldState = rememberBottomSheetScaffoldState(
bottomSheetState = bottomSheetState,
snackbarHostState = screenSharedState.snackbarHostState
Expand Down

0 comments on commit 45c5111

Please sign in to comment.