Skip to content

OpenProject is the leading open source project management software for product, project and portfolio management. A powerful Jira alternative with agile planning, issue tracking, roadmaps, Gantt charts, time tracking, collaboration features, and more. Available on premises or in the cloud. ⭐ Star us on GitHub

Fix double init of base view

Oliver Günther41c22b00552a
diff --git a/frontend/src/app/features/work-packages/routing/wp-view-base/work-package-single-view.base.ts b/frontend/src/app/features/work-packages/routing/wp-view-base/work-package-single-view.base.ts
index faaf395d2ec..ef397459392 100644
--- a/frontend/src/app/features/work-packages/routing/wp-view-base/work-package-single-view.base.ts
+++ b/frontend/src/app/features/work-packages/routing/wp-view-base/work-package-single-view.base.ts
@@ -103,6 +103,7 @@ export class WorkPackageSingleViewBase extends UntilDestroyedMixin {
*/
protected observeWorkPackage() {
/** Require the work package once to ensure we're displaying errors */
+ let initialized = false;
this
.apiV3Service
.work_packages
@@ -113,7 +114,10 @@ export class WorkPackageSingleViewBase extends UntilDestroyedMixin {
)
.subscribe((wp:WorkPackageResource) => {
this.workPackage = wp;
- this.init();
+ if (!initialized) {
+ this.init();
+ initialized = true;
+ }
this.cdRef.detectChanges();
},
(error) => this.notificationService.handleRawError(error));