This commit is contained in:
unknown 2018-06-17 13:07:51 -07:00
parent 2dbf64b048
commit b83464f7c7
2 changed files with 4 additions and 4 deletions

View File

@ -92,7 +92,6 @@ class _InvoiceNinjaAppState extends State<InvoiceNinjaApp> {
return LoginVM();
},
DashboardScreen.route: (context) {
print('here...');
widget.store.dispatch(LoadDashboardAction());
return DashboardScreen();
},
@ -105,13 +104,13 @@ class _InvoiceNinjaAppState extends State<InvoiceNinjaApp> {
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(),
},
),

View File

@ -145,9 +145,10 @@ Middleware<AppState> _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');
}