Fix unable to open drawer after double clicked

This commit is contained in:
FooIbar committed 2023-11-03 00:46:10 +08:00
1 parent 614e847de0
commit 67feb19cab
1 file changed
+2 -1
@@ -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()
}
}