@@ -59,23 +59,33 @@ class RouteGuard {
5959 String ? Function () getPendingRoute,
6060 void Function (String ? ) setPendingRoute,
6161 ) async {
62- final hasOnboarded = await onboardingRepo.isOnboardingCompleted ().then (
63- (result) =>
64- result.fold ((failure) => false , (hasCompleted) => hasCompleted),
65- );
66-
67- // Force onboarding if not completed
68- if (! hasOnboarded &&
69- path != AppRoutes .onboarding &&
70- path != AppRoutes .login) {
71- return AppRoutes .onboarding;
72- }
73-
74- // Skip onboarding if already done
75- if (hasOnboarded && path == AppRoutes .onboarding) {
62+ // Onboarding is temporarily disabled for everyone. Never force it, and
63+ // send any direct navigation to /onboarding back to home. This also fixes
64+ // the offline case, where the original check below defaulted to "not
65+ // onboarded" and wrongly forced onboarding.
66+ if (path == AppRoutes .onboarding) {
7667 return AppRoutes .home;
7768 }
7869
70+ // Original force-onboarding logic, preserved (commented out) so it can be
71+ // re-enabled later by deleting the redirect above and uncommenting this.
72+ // final hasOnboarded = await onboardingRepo.isOnboardingCompleted().then(
73+ // (result) =>
74+ // result.fold((failure) => false, (hasCompleted) => hasCompleted),
75+ // );
76+ //
77+ // // Force onboarding if not completed
78+ // if (!hasOnboarded &&
79+ // path != AppRoutes.onboarding &&
80+ // path != AppRoutes.login) {
81+ // return AppRoutes.onboarding;
82+ // }
83+ //
84+ // // Skip onboarding if already done
85+ // if (hasOnboarded && path == AppRoutes.onboarding) {
86+ // return AppRoutes.home;
87+ // }
88+
7989 // Redirect from login or splash to pending route or home
8090 if (path == AppRoutes .login || path == AppRoutes .splash) {
8191 final pending = getPendingRoute ();
0 commit comments