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 let permissionsPageIndex = 5
static func pageOrder( static func pageOrder(
for mode: AppState.ConnectionMode, for mode: AppState.ConnectionMode,
needsBootstrap: Bool) -> [Int] showOnboardingChat: Bool) -> [Int]
{ {
switch mode { switch mode {
case .remote: case .remote:
// Remote setup doesn't need local gateway/CLI/workspace setup pages, // Remote setup doesn't need local gateway/CLI/workspace setup pages,
// and WhatsApp/Telegram setup is optional. // 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: case .unconfigured:
needsBootstrap ? [0, 1, 8, 9] : [0, 1, 9] showOnboardingChat ? [0, 1, 8, 9] : [0, 1, 9]
case .local: 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] { 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 } var pageCount: Int { self.pageOrder.count }

View File

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