diff --git a/lib/redux/dashboard/dashboard_reducer.dart b/lib/redux/dashboard/dashboard_reducer.dart index 3a2be0cf7..bdfc7bdba 100644 --- a/lib/redux/dashboard/dashboard_reducer.dart +++ b/lib/redux/dashboard/dashboard_reducer.dart @@ -9,13 +9,14 @@ final dashboardReducer = combineReducers([ ]); DashboardState _setLoadedDashboards(DashboardState dashboardState, DashboardLoadedAction action) { - return dashboardState.copyWith( - data: action.data + return DashboardState().copyWith( + lastUpdated: DateTime.now().millisecondsSinceEpoch, + data: action.data ); } DashboardState _setNoDashboards(DashboardState dashboardState, DashboardNotLoadedAction action) { - return dashboardState.copyWith( + return DashboardState().copyWith( data: DashboardEntity() ); } diff --git a/lib/redux/product/product_reducer.dart b/lib/redux/product/product_reducer.dart index 3796d7bbe..a39bcffaf 100644 --- a/lib/redux/product/product_reducer.dart +++ b/lib/redux/product/product_reducer.dart @@ -43,7 +43,8 @@ List _toggleAll(List products, ToggleAllAction act */ ProductState _setLoadedProducts(ProductState productState, ProductsLoadedAction action) { - return productState.copyWith( + return ProductState().copyWith( + lastUpdated: DateTime.now().millisecondsSinceEpoch, map: Map.fromIterable(action.products, key: (item) => item.id, value: (item) => item @@ -53,5 +54,5 @@ ProductState _setLoadedProducts(ProductState productState, ProductsLoadedAction } ProductState _setNoProducts(ProductState productState, ProductsNotLoadedAction action) { - return productState; + return ProductState(); }