diff --git a/lib/redux/project/project_actions.dart b/lib/redux/project/project_actions.dart index 95f2820e2..12f2281f5 100644 --- a/lib/redux/project/project_actions.dart +++ b/lib/redux/project/project_actions.dart @@ -272,6 +272,12 @@ void handleProjectAction( ..projectId = project.id ..clientId = project.clientId)); break; + case EntityAction.newInvoice: + createEntity( + context: context, + entity: InvoiceEntity(state: state, client: client) + .rebuild((b) => b..projectId = project.id)); + break; case EntityAction.invoiceProject: String lastClientId = ''; bool hasMultipleClients = false; @@ -373,6 +379,8 @@ void handleProjectAction( ), ); break; + default: + print('## Error: action $action not handled in project_actions'); } } diff --git a/lib/ui/app/entities/entity_list_tile.dart b/lib/ui/app/entities/entity_list_tile.dart index 2c084414e..469957959 100644 --- a/lib/ui/app/entities/entity_list_tile.dart +++ b/lib/ui/app/entities/entity_list_tile.dart @@ -181,10 +181,12 @@ class _EntitiesListTileState extends State { final store = StoreProvider.of(context); final uiState = store.state.uiState; final entity = widget.entity; + if (uiState.filterEntityId != entity.id || uiState.filterEntityType != entity.entityType) { store.dispatch(FilterByEntity(entity: entity)); } + handleEntityAction(entity, EntityAction.newEntityType(widget.entityType)); } diff --git a/lib/ui/project/view/project_view_overview.dart b/lib/ui/project/view/project_view_overview.dart index dd57b45f1..b750dc616 100644 --- a/lib/ui/project/view/project_view_overview.dart +++ b/lib/ui/project/view/project_view_overview.dart @@ -148,7 +148,6 @@ class _ProjectOverviewState extends State { subtitle: memoizedInvoiceStatsForProject( project.id, state.invoiceState.map) .present(localization.active, localization.archived), - hideNew: true, ), ];