1.1.5: auto-fill first week after onboarding
Land new users on a ready, auto-planned week (with confetti) instead of an empty one, to improve activation. Only fires when the user added dishes; otherwise keeps the current empty-week + auto-assign prompt behavior. Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
This commit is contained in:
@@ -956,6 +956,17 @@ struct HomeView: View {
|
||||
guard !hasEvaluatedPostOnboardingPrompts else { return }
|
||||
hasEvaluatedPostOnboardingPrompts = true
|
||||
|
||||
// Auto-fill the first week so the user lands on a ready plan (with confetti)
|
||||
// instead of being asked. Reuses the home's autoComplete choreography.
|
||||
if UserDefaults.standard.bool(forKey: OnboardingViewModel.pendingAutoFillOnLaunchKey) {
|
||||
UserDefaults.standard.set(false, forKey: OnboardingViewModel.pendingAutoFillOnLaunchKey)
|
||||
if !dishes.isEmpty && plan.slots.contains(where: { $0.dishId == nil && !$0.isEatingOut }) {
|
||||
viewModel.autoComplete(plan: plan, dishes: dishes, tags: tags, settings: settings, allPlans: weekPlans)
|
||||
}
|
||||
schedulePostOnboardingPremiumPromptIfNeeded(settings: settings)
|
||||
return
|
||||
}
|
||||
|
||||
let shouldAskAutoAssign = UserDefaults.standard.bool(forKey: OnboardingViewModel.pendingAutoAssignPromptKey)
|
||||
if shouldAskAutoAssign && plan.slots.contains(where: { $0.dishId == nil }) {
|
||||
showPostOnboardingAutoAssignPrompt = true
|
||||
|
||||
Reference in New Issue
Block a user