diff --git a/dmp-frontend/src/app/ui/quick-wizard/grant-editor/grant-editor-wizard.component.ts b/dmp-frontend/src/app/ui/quick-wizard/grant-editor/grant-editor-wizard.component.ts index 222d35445..f74216ded 100644 --- a/dmp-frontend/src/app/ui/quick-wizard/grant-editor/grant-editor-wizard.component.ts +++ b/dmp-frontend/src/app/ui/quick-wizard/grant-editor/grant-editor-wizard.component.ts @@ -79,25 +79,28 @@ export class GrantEditorWizardComponent extends BaseComponent implements OnInit, this.grantformGroup.get('existGrant').disable(); } - this.funderFormGroup.statusChanges.pipe(takeUntil(this._destroyed)).subscribe(x => { - if (x == 'INVALID') { - this.grantformGroup.get('existGrant').reset(); - this.grantformGroup.get('label').reset(); - this.grantformGroup.get('description').reset(); - this.grantformGroup.get('existGrant').disable(); - this.grantformGroup.get('label').disable(); - this.grantformGroup.get('description').disable(); - } else if (x == 'VALID') { - if (!this.isNew) { + this.funderFormGroup.statusChanges + .pipe(takeUntil(this._destroyed)) + .subscribe(x => { + this.grantformGroup.reset(); + if (x == 'INVALID') { + this.grantformGroup.get('existGrant').reset(); this.grantformGroup.get('label').reset(); this.grantformGroup.get('description').reset(); + this.grantformGroup.get('existGrant').disable(); this.grantformGroup.get('label').disable(); this.grantformGroup.get('description').disable(); - this.grantformGroup.get('existGrant').enable(); + } else if (x == 'VALID') { + if (!this.isNew) { + this.grantformGroup.get('label').reset(); + this.grantformGroup.get('description').reset(); + this.grantformGroup.get('label').disable(); + this.grantformGroup.get('description').disable(); + this.grantformGroup.get('existGrant').enable(); + } } - } - }) + }) } isFunderFormInvalid() {