fix
This commit is contained in:
@@ -58,7 +58,7 @@ internal class FeedComponent(
|
|||||||
val lifecycleOwner = LocalLifecycleOwner.current
|
val lifecycleOwner = LocalLifecycleOwner.current
|
||||||
|
|
||||||
val progress = state.currentProgress
|
val progress = state.currentProgress
|
||||||
val feedProgress = remember { mutableFloatStateOf(0f) }
|
val feedProgress = remember { mutableFloatStateOf(-1f) }
|
||||||
|
|
||||||
val feedProviderPackage by remember { feedSettings.providerPackage }.collectAsState(null)
|
val feedProviderPackage by remember { feedSettings.providerPackage }.collectAsState(null)
|
||||||
|
|
||||||
@@ -80,39 +80,39 @@ internal class FeedComponent(
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
val componentState = this.state.intValue
|
|
||||||
|
|
||||||
LaunchedEffect(state.currentComponent == this && componentState < 2) {
|
if (state.currentComponent == this) {
|
||||||
if (state.currentComponent == this@FeedComponent && componentState < 2) {
|
LaunchedEffect(Unit) {
|
||||||
feedConnection?.startScroll()
|
feedConnection?.startScroll()
|
||||||
}
|
}
|
||||||
}
|
LaunchedEffect(state.isSettledOnSecondaryPage, progress > 0.8f) {
|
||||||
|
if (state.isSettledOnSecondaryPage && progress > 0.8f) {
|
||||||
LaunchedEffect(componentState == 2 && progress > 0.5f) {
|
feedConnection?.endScroll()
|
||||||
if (componentState == 2 && progress > 0.5f) {
|
|
||||||
feedConnection?.endScroll()
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
LaunchedEffect(componentState == 0) {
|
|
||||||
if (componentState == 0) {
|
|
||||||
feedConnection?.closeFeed()
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
LaunchedEffect(state.currentComponent == this, progress) {
|
|
||||||
if (state.currentComponent == this@FeedComponent) {
|
|
||||||
feedConnection?.onScroll(progress)
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
LaunchedEffect(feedProgress.floatValue) {
|
|
||||||
if (isActive) {
|
|
||||||
state.setProgress(feedProgress.floatValue)
|
|
||||||
if (feedProgress.floatValue <= 0f) {
|
|
||||||
state.onPredictiveBackEnd()
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
LaunchedEffect(progress) {
|
||||||
|
if (feedProgress.floatValue != progress) {
|
||||||
|
feedConnection?.onScroll(progress)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
LaunchedEffect(
|
||||||
|
isActive,
|
||||||
|
feedProgress.floatValue
|
||||||
|
) {
|
||||||
|
if (isActive) {
|
||||||
|
state.setProgress(feedProgress.floatValue)
|
||||||
|
if (feedProgress.floatValue <= 0f) {
|
||||||
|
feedConnection?.closeFeed()
|
||||||
|
state.onPredictiveBackEnd()
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
LaunchedEffect(Unit) {
|
||||||
|
feedConnection?.closeFeed()
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
Column(
|
Column(
|
||||||
|
|||||||
Reference in New Issue
Block a user