diff --git a/app/src/main/kotlin/com/hippo/ehviewer/ui/MainActivity.kt b/app/src/main/kotlin/com/hippo/ehviewer/ui/MainActivity.kt index 082acdbd6..4f4c75b0a 100644 --- a/app/src/main/kotlin/com/hippo/ehviewer/ui/MainActivity.kt +++ b/app/src/main/kotlin/com/hippo/ehviewer/ui/MainActivity.kt @@ -112,6 +112,7 @@ import java.io.FileOutputStream import kotlinx.coroutines.delay import kotlinx.coroutines.flow.MutableSharedFlow import kotlinx.coroutines.flow.MutableStateFlow +import kotlinx.coroutines.flow.collectLatest import kotlinx.coroutines.flow.first import kotlinx.coroutines.launch import splitties.systemservices.clipboardManager @@ -231,7 +232,7 @@ class MainActivity : EhActivity() { fun isSelected(id: Int) = ::navController.isInitialized && id == navController.currentDestination?.id fun closeDrawer() = scope.launch { drawerState.close() } LaunchedEffect(Unit) { - openDrawerFlow.collect { + openDrawerFlow.collectLatest { drawerState.open() } }