diff --git a/Shared/FuelStore.swift b/Shared/FuelStore.swift index dc05a2b..eccb247 100644 --- a/Shared/FuelStore.swift +++ b/Shared/FuelStore.swift @@ -934,15 +934,19 @@ struct FuelStore { } // MARK: Onboarding — the app shows the intro screen on first launch only - // (a test button in the Alerts tab re-opens it). Stored in the app group - // so the widget can see it too if ever needed. + // (a test button in the Alerts tab re-opens it). Stored KEYCHAIN-FIRST + // (with an app-group mirror) for the same reason as favourites/distance + // unit: free SideStore accounts don't provision the app-group container, + // so an app-group-only flag silently fails to save AND reloads as false, + // making onboarding re-appear on every launch. Keychain survives reinstall + // and is shared with the extension. static func loadHasCompletedOnboarding() -> Bool { - UserDefaults(suiteName: appGroupSuite)?.bool(forKey: onboardingCompletedKey) ?? false + (loadString(service: onboardingCompletedKey) ?? "0") == "1" } static func saveHasCompletedOnboarding(_ completed: Bool) { - UserDefaults(suiteName: appGroupSuite)?.set(completed, forKey: onboardingCompletedKey) + saveString(completed ? "1" : "0", service: onboardingCompletedKey) } // MARK: Road distances (Apple-Maps-matched, computed by the app)