diff --git a/lib/redux/document/document_middleware.dart b/lib/redux/document/document_middleware.dart index 3affdd5b8..3d1a7a838 100644 --- a/lib/redux/document/document_middleware.dart +++ b/lib/redux/document/document_middleware.dart @@ -107,10 +107,14 @@ Middleware _saveDocument(DocumentRepository repository) { repository .saveData(store.state.credentials, action.document) .then((DocumentEntity document) { + document = document.rebuild((b) => b + ..parentId = action.document.parentId + ..parentType = action.document.parentType); + store.dispatch(SaveDocumentSuccess(document)); if (action.completer != null) { - action.completer.complete(null); + action.completer.complete(document); } }).catchError((Object error) { print(error); diff --git a/lib/ui/app/presenters/entity_presenter.dart b/lib/ui/app/presenters/entity_presenter.dart index 9defcb671..dc8dc8a10 100644 --- a/lib/ui/app/presenters/entity_presenter.dart +++ b/lib/ui/app/presenters/entity_presenter.dart @@ -40,6 +40,7 @@ class EntityPresenter { EntityType.user, EntityType.product, EntityType.transaction, + EntityType.document, ].contains(entity.entityType) || isNarrow) { return name;