u
This commit is contained in:
@@ -28,6 +28,7 @@ import {
|
||||
buildManifestBody,
|
||||
restoreAttachmentsFromApi,
|
||||
dateInputValue,
|
||||
todayInputValue,
|
||||
emptyLine,
|
||||
lineFromApi,
|
||||
manifestConfig,
|
||||
@@ -107,8 +108,13 @@ class LieferungNeuPage extends PureComponent {
|
||||
super(props);
|
||||
this.cfg = manifestConfig('delivery');
|
||||
this.automat = getDeliveryEditorAutomat(props.docId);
|
||||
const initialDate = this.automat.state.date || (props.docId == null ? todayInputValue() : null);
|
||||
if (props.docId == null && !this.automat.state.date) {
|
||||
this.automat.actions.setDate(initialDate);
|
||||
}
|
||||
this.state = {
|
||||
...this.automat.state,
|
||||
date: initialDate,
|
||||
status: props.docId != null ? 'loading' : 'loadingParties',
|
||||
error: null,
|
||||
partiesLoading: true,
|
||||
@@ -199,6 +205,9 @@ class LieferungNeuPage extends PureComponent {
|
||||
if (this.props.docId != null) {
|
||||
void this.loadEdit();
|
||||
} else {
|
||||
if (!this.automat.state.date) {
|
||||
this.automat.actions.setDate(todayInputValue());
|
||||
}
|
||||
void this.loadPartiesOnly();
|
||||
if (this.props.initialDelivery) {
|
||||
this.automat.actions.setDelivery(this.props.initialDelivery);
|
||||
|
||||
Reference in New Issue
Block a user