mirror of
https://github.com/openclaw/openclaw.git
synced 2026-07-09 01:58:56 +08:00
fix(ios): skip onboarding for configured gateways (#101481)
* fix(ios): skip onboarding for configured gateways Fixes #98570 * fix(ios): prioritize saved gateway state
This commit is contained in:
committed by
GitHub
parent
686b778468
commit
cc2c6a87dc
@@ -243,13 +243,15 @@ extension RootTabs {
|
||||
if gatewayConnected {
|
||||
return .none
|
||||
}
|
||||
// Saved gateway state survives independently of the onboarding markers.
|
||||
// Explicit resets bypass this route through evaluateOnboardingPresentation(force:).
|
||||
if hasExistingGatewayConfig {
|
||||
return .none
|
||||
}
|
||||
if shouldPresentOnLaunch || !hasConnectedOnce || !onboardingComplete {
|
||||
return .onboarding
|
||||
}
|
||||
if !hasExistingGatewayConfig {
|
||||
return .settings
|
||||
}
|
||||
return .none
|
||||
return .settings
|
||||
}
|
||||
|
||||
static func shouldPresentQuickSetup(
|
||||
|
||||
@@ -5,6 +5,39 @@ import UIKit
|
||||
|
||||
@MainActor
|
||||
struct RootTabsPresentationTests {
|
||||
@Test func `configured gateway bypasses launch request and stale onboarding markers`() {
|
||||
let route = RootTabs.startupPresentationRoute(
|
||||
gatewayConnected: false,
|
||||
hasConnectedOnce: false,
|
||||
onboardingComplete: false,
|
||||
hasExistingGatewayConfig: true,
|
||||
shouldPresentOnLaunch: true)
|
||||
|
||||
#expect(route == .none)
|
||||
}
|
||||
|
||||
@Test func `fresh install presents onboarding`() {
|
||||
let route = RootTabs.startupPresentationRoute(
|
||||
gatewayConnected: false,
|
||||
hasConnectedOnce: false,
|
||||
onboardingComplete: false,
|
||||
hasExistingGatewayConfig: false,
|
||||
shouldPresentOnLaunch: false)
|
||||
|
||||
#expect(route == .onboarding)
|
||||
}
|
||||
|
||||
@Test func `completed setup without gateway opens settings`() {
|
||||
let route = RootTabs.startupPresentationRoute(
|
||||
gatewayConnected: false,
|
||||
hasConnectedOnce: true,
|
||||
onboardingComplete: true,
|
||||
hasExistingGatewayConfig: false,
|
||||
shouldPresentOnLaunch: false)
|
||||
|
||||
#expect(route == .settings)
|
||||
}
|
||||
|
||||
@Test func `quick setup does not present when gateway already configured`() {
|
||||
let shouldPresent = RootTabs.shouldPresentQuickSetup(
|
||||
quickSetupDismissed: false,
|
||||
|
||||
Reference in New Issue
Block a user