diff --git a/lib/main.dart b/lib/main.dart index ca84d2285..b6b9b7e2e 100644 --- a/lib/main.dart +++ b/lib/main.dart @@ -92,7 +92,6 @@ class _InvoiceNinjaAppState extends State { return LoginVM(); }, DashboardScreen.route: (context) { - print('here...'); widget.store.dispatch(LoadDashboardAction()); return DashboardScreen(); }, @@ -105,13 +104,13 @@ class _InvoiceNinjaAppState extends State { widget.store.dispatch(LoadClients()); return ClientScreen(); }, - ClientViewScreen.route: (context) => ClientEditScreen(), + ClientViewScreen.route: (context) => ClientViewScreen(), ClientEditScreen.route: (context) => ClientEditScreen(), InvoiceScreen.route: (context) { widget.store.dispatch(LoadInvoices()); return InvoiceScreen(); }, - //InvoiceViewScreen.route: (context) => InvoiceEditScreen(), + //InvoiceViewScreen.route: (context) => InvoiceViewScreen(), InvoiceEditScreen.route: (context) => InvoiceEditScreen(), }, ), diff --git a/lib/redux/app/app_middleware.dart b/lib/redux/app/app_middleware.dart index 420e528c7..bd04075de 100644 --- a/lib/redux/app/app_middleware.dart +++ b/lib/redux/app/app_middleware.dart @@ -145,9 +145,10 @@ Middleware _createLoadState( var route = ''; bool isFirst = true; print('current route: ' + uiState.currentRoute); + print('auth URL: ' + authState.url); uiState.currentRoute.split('/').forEach((part) { if (part.isNotEmpty) { - if (part == 'edit' && route != '/products') { + if (part == 'edit' && route != '/products' && route != '/invoices') { navigator.pushNamed(route + '/view'); print('push: ' + route + '/view'); }