Skip to content

Commit

Permalink
🐛 shouldKeepOnScreen の判定を修正
Browse files Browse the repository at this point in the history
  • Loading branch information
tatsutakein committed Nov 23, 2023
1 parent e542827 commit ddf79a5
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
6 changes: 3 additions & 3 deletions app/android/src/main/java/club/nito/app/MainActivity.kt
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,8 @@ class MainActivity : ComponentActivity() {
val splashScreen = installSplashScreen()
super.onCreate(savedInstanceState)

var initialized by mutableStateOf(false)
splashScreen.setKeepOnScreenCondition { initialized }
var shouldKeep by mutableStateOf(true)
splashScreen.setKeepOnScreenCondition { shouldKeep }

enableEdgeToEdge(
statusBarStyle = SystemBarStyle.auto(
Expand All @@ -35,7 +35,7 @@ class MainActivity : ComponentActivity() {

setContent {
NitoApp(
initialized = { initialized = it },
shouldKeepOnScreen = { shouldKeep = it },
)
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ import org.koin.dsl.module

@Composable
fun NitoApp(
initialized: (Boolean) -> Unit,
shouldKeepOnScreen: (Boolean) -> Unit,
modifier: Modifier = Modifier,
) {
PreComposeApp {
Expand Down Expand Up @@ -58,7 +58,7 @@ fun NitoApp(
val stateMachine = koinStateMachine<NitoAppStateMachine>()
val uiState = stateMachine.uiState.collectAsStateWithLifecycle()
LaunchedEffect(uiState.value) {
initialized(uiState.value is NitoAppUiState.Success)
shouldKeepOnScreen((uiState.value is NitoAppUiState.Success).not())
}

when (val state = uiState.value) {
Expand Down

0 comments on commit ddf79a5

Please sign in to comment.