fix: hide onboarding chat when configured

This commit is contained in:
Peter Steinberger
2026-01-11 10:34:20 +00:00
parent a83f86a4a1
commit d8a13481eb
2 changed files with 10 additions and 6 deletions

View File

@@ -120,22 +120,26 @@ struct OnboardingView: View {
let permissionsPageIndex = 5
static func pageOrder(
for mode: AppState.ConnectionMode,
needsBootstrap: Bool) -> [Int]
showOnboardingChat: Bool) -> [Int]
{
switch mode {
case .remote:
// Remote setup doesn't need local gateway/CLI/workspace setup pages,
// and WhatsApp/Telegram setup is optional.
needsBootstrap ? [0, 1, 5, 8, 9] : [0, 1, 5, 9]
showOnboardingChat ? [0, 1, 5, 8, 9] : [0, 1, 5, 9]
case .unconfigured:
needsBootstrap ? [0, 1, 8, 9] : [0, 1, 9]
showOnboardingChat ? [0, 1, 8, 9] : [0, 1, 9]
case .local:
needsBootstrap ? [0, 1, 3, 5, 8, 9] : [0, 1, 3, 5, 9]
showOnboardingChat ? [0, 1, 3, 5, 8, 9] : [0, 1, 3, 5, 9]
}
}
var showOnboardingChat: Bool {
self.state.connectionMode == .local && self.needsBootstrap
}
var pageOrder: [Int] {
Self.pageOrder(for: self.state.connectionMode, needsBootstrap: self.needsBootstrap)
Self.pageOrder(for: self.state.connectionMode, showOnboardingChat: self.showOnboardingChat)
}
var pageCount: Int { self.pageOrder.count }

View File

@@ -3,7 +3,7 @@ import Foundation
extension OnboardingView {
func maybeKickoffOnboardingChat(for pageIndex: Int) {
guard pageIndex == self.onboardingChatPageIndex else { return }
guard self.needsBootstrap else { return }
guard self.showOnboardingChat else { return }
guard !self.didAutoKickoff else { return }
self.didAutoKickoff = true