fix(challenges): null-safe activeChallenge guard; feat(this-or-that): skip question button

This commit is contained in:
null 2026-06-23 11:31:17 -05:00
parent b854c0b391
commit acaa8e635c
2 changed files with 16 additions and 2 deletions

View File

@ -301,8 +301,12 @@ fun ConnectionChallengesScreen(
onPick = { viewModel.startChallenge(it) },
onPaywall = { onNavigate(AppRoute.PAYWALL) }
)
ChallengesPhase.ACTIVE -> ChallengesActiveScreen(
challenge = state.activeChallenge!!,
ChallengesPhase.ACTIVE -> {
val activeChallenge = state.activeChallenge
if (activeChallenge == null) {
ChallengesLoadingScreen()
} else ChallengesActiveScreen(
challenge = activeChallenge,
progress = state.progress ?: ChallengeProgressState(),
challengeState = state.challengeState,
onBack = { onNavigate(AppRoute.PLAY) },
@ -316,6 +320,7 @@ fun ConnectionChallengesScreen(
}
}
}
}
}
// ── Loading ───────────────────────────────────────────────────────────────────

View File

@ -701,6 +701,15 @@ private fun ThisOrThatContent(
accentColor = CloserPalette.PinkAccentDeep,
onSelect = onSelect
)
} else {
Box(
modifier = Modifier.fillMaxWidth(),
contentAlignment = Alignment.Center
) {
TextButton(onClick = { onSelect("") }) {
Text("Skip question", color = MaterialTheme.colorScheme.onSurfaceVariant)
}
}
}
}
}