Skip to content

Commit

Permalink
fix onboarding
Browse files Browse the repository at this point in the history
  • Loading branch information
sadespresso committed Dec 31, 2024
1 parent 8108dbc commit 6161609
Show file tree
Hide file tree
Showing 3 changed files with 19 additions and 2 deletions.
6 changes: 5 additions & 1 deletion lib/routes.dart
Original file line number Diff line number Diff line change
Expand Up @@ -237,7 +237,11 @@ final router = GoRouter(
),
GoRoute(
path: "/import",
builder: (context, state) => const ImportPage(),
builder: (context, state) {
return ImportPage(
setupMode: state.uri.queryParameters["setupMode"] == "true",
);
},
),
GoRoute(
path: "/import/wizard/v1",
Expand Down
13 changes: 13 additions & 0 deletions lib/routes/home_page.dart
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import "dart:async";
import "dart:developer";

import "package:flow/entity/account.dart";
import "package:flow/entity/transaction.dart";
Expand Down Expand Up @@ -56,6 +57,18 @@ class _HomePageState extends State<HomePage>
if (LocalPreferences().completedInitialSetup.get()) return;

context.pushReplacement("/setup");

unawaited(
LocalPreferences().completedInitialSetup.set(true).catchError(
(error) {
log(
"Failed to set LocalPreferences().completedInitialSetup -> true",
error: error,
);
return false;
},
),
);
});
}

Expand Down
2 changes: 1 addition & 1 deletion lib/routes/setup/setup_onboarding_page.dart
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ class SetupOnboardingPage extends StatelessWidget {
),
const SizedBox(height: 16.0),
ActionCard(
onTap: () => context.push("/import"),
onTap: () => context.push("/import?setupMode=true"),
builder: (context) => Padding(
padding: const EdgeInsets.symmetric(
horizontal: 24.0,
Expand Down

0 comments on commit 6161609

Please sign in to comment.