diff --git a/frontend/src/app/components/wp-buttons/wp-status-button/wp-status-button.component.ts b/frontend/src/app/components/wp-buttons/wp-status-button/wp-status-button.component.ts index 95b08cb309..4b6ed9becc 100644 --- a/frontend/src/app/components/wp-buttons/wp-status-button/wp-status-button.component.ts +++ b/frontend/src/app/components/wp-buttons/wp-status-button/wp-status-button.component.ts @@ -60,26 +60,19 @@ export class WorkPackageStatusButtonComponent implements OnInit, OnDestroy { } ngOnInit() { - this.wpCacheService - .observe(this.workPackage.id!) + this.wpEditing + .temporaryEditResource(this.workPackage.id!) + .values$() .pipe( untilComponentDestroyed(this) ) .subscribe((wp) => { this.workPackage = wp; this.cdRef.detectChanges(); - this.workPackage.status.$load(); - }); - this.schemaCacheService - .state(this.workPackage) - .changes$() - .pipe( - untilComponentDestroyed(this) - ) - .subscribe(() => { - // we have to explicitly force the component to update - this.cdRef.detectChanges(); + if (this.workPackage.status) { + this.workPackage.status.$load(); + } }); } diff --git a/frontend/src/app/components/wp-edit-form/work-package-changeset.ts b/frontend/src/app/components/wp-edit-form/work-package-changeset.ts index aa7ad02a27..0ce5096b5f 100644 --- a/frontend/src/app/components/wp-edit-form/work-package-changeset.ts +++ b/frontend/src/app/components/wp-edit-form/work-package-changeset.ts @@ -124,10 +124,6 @@ export class WorkPackageChangeset extends EditChangeset { .update(payload) .then((form:FormResource) => { this.form = form; - if (!this.resource.isNew) { - this.schemaCacheService.state(this.resource).putValue(form.schema); - } - this.rebuildDefaults(form.payload); this.buildResource();