From 304677e722aef32861ab6ae17422efa54c4bd67d Mon Sep 17 00:00:00 2001 From: Denys Vuika Date: Thu, 25 May 2023 21:59:53 +0100 Subject: [PATCH] fix details component destruction --- .../components/details/details.component.ts | 19 +++++++------------ 1 file changed, 7 insertions(+), 12 deletions(-) diff --git a/projects/aca-content/src/lib/components/details/details.component.ts b/projects/aca-content/src/lib/components/details/details.component.ts index d7033cfe1..0856669c4 100644 --- a/projects/aca-content/src/lib/components/details/details.component.ts +++ b/projects/aca-content/src/lib/components/details/details.component.ts @@ -22,11 +22,10 @@ * from Hyland Software. If not, see . */ -import { Component, OnInit, ViewEncapsulation, OnDestroy } from '@angular/core'; +import { Component, OnInit, ViewEncapsulation, OnDestroy, inject } from '@angular/core'; import { ActivatedRoute } from '@angular/router'; import { ContentApiService, PageComponent } from '@alfresco/aca-shared'; import { NavigateToPreviousPage, SetSelectedNodesAction } from '@alfresco/aca-shared/store'; -import { Subject } from 'rxjs'; @Component({ selector: 'app-details-manager', @@ -35,20 +34,18 @@ import { Subject } from 'rxjs'; encapsulation: ViewEncapsulation.None }) export class DetailsComponent extends PageComponent implements OnInit, OnDestroy { + private route = inject(ActivatedRoute); + private contentApi = inject(ContentApiService); + nodeId: string; isLoading: boolean; - onDestroy$ = new Subject(); activeTab = 1; - constructor(private route: ActivatedRoute, private contentApi: ContentApiService) { - super(); - } - ngOnInit(): void { super.ngOnInit(); + this.isLoading = true; - const { route } = this; - const { data } = route.snapshot; + const { data } = this.route.snapshot; this.title = data.title; this.route.params.subscribe((params) => { @@ -82,8 +79,6 @@ export class DetailsComponent extends PageComponent implements OnInit, OnDestroy } ngOnDestroy(): void { - this.store.dispatch(new SetSelectedNodesAction([])); - this.onDestroy$.next(); - this.onDestroy$.complete(); + super.ngOnDestroy(); } }