From 32b32d5a68b474305a2bc7bf3c10346957ea7733 Mon Sep 17 00:00:00 2001 From: Hillel Coren Date: Thu, 20 Feb 2020 22:36:39 +0200 Subject: [PATCH] History fixes --- lib/ui/app/main_screen.dart | 26 +++++++++++++++++++++----- 1 file changed, 21 insertions(+), 5 deletions(-) diff --git a/lib/ui/app/main_screen.dart b/lib/ui/app/main_screen.dart index 37f342b8d..cfb857fa1 100644 --- a/lib/ui/app/main_screen.dart +++ b/lib/ui/app/main_screen.dart @@ -5,6 +5,9 @@ import 'package:invoiceninja_flutter/data/models/entities.dart'; import 'package:invoiceninja_flutter/redux/app/app_actions.dart'; import 'package:invoiceninja_flutter/redux/app/app_state.dart'; import 'package:invoiceninja_flutter/redux/client/client_actions.dart'; +import 'package:invoiceninja_flutter/redux/dashboard/dashboard_actions.dart'; +import 'package:invoiceninja_flutter/redux/reports/reports_actions.dart'; +import 'package:invoiceninja_flutter/redux/settings/settings_actions.dart'; import 'package:invoiceninja_flutter/ui/app/history_drawer_vm.dart'; import 'package:invoiceninja_flutter/ui/app/menu_drawer_vm.dart'; import 'package:invoiceninja_flutter/ui/app/help_text.dart'; @@ -176,11 +179,24 @@ class MainScreen extends StatelessWidget { store.dispatch(PopLastHistory()); } - viewEntityById( - entityType: history.entityType, - entityId: history.id, - context: context, - ); + switch (history.entityType) { + case EntityType.dashboard: + store.dispatch( + ViewDashboard(navigator: Navigator.of(context))); + break; + case EntityType.reports: + store.dispatch(ViewReports(navigator: Navigator.of(context))); + break; + case EntityType.settings: + store + .dispatch(ViewSettings(navigator: Navigator.of(context))); + break; + default: + viewEntityById( + context: context, + entityId: history.id, + entityType: history.entityType); + } return false; },