mirror of
https://github.com/Alfresco/alfresco-content-app.git
synced 2025-09-17 14:21:14 +00:00
fix details component destruction
This commit is contained in:
@@ -22,11 +22,10 @@
|
|||||||
* from Hyland Software. If not, see <http://www.gnu.org/licenses/>.
|
* from Hyland Software. If not, see <http://www.gnu.org/licenses/>.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
import { Component, OnInit, ViewEncapsulation, OnDestroy } from '@angular/core';
|
import { Component, OnInit, ViewEncapsulation, OnDestroy, inject } from '@angular/core';
|
||||||
import { ActivatedRoute } from '@angular/router';
|
import { ActivatedRoute } from '@angular/router';
|
||||||
import { ContentApiService, PageComponent } from '@alfresco/aca-shared';
|
import { ContentApiService, PageComponent } from '@alfresco/aca-shared';
|
||||||
import { NavigateToPreviousPage, SetSelectedNodesAction } from '@alfresco/aca-shared/store';
|
import { NavigateToPreviousPage, SetSelectedNodesAction } from '@alfresco/aca-shared/store';
|
||||||
import { Subject } from 'rxjs';
|
|
||||||
|
|
||||||
@Component({
|
@Component({
|
||||||
selector: 'app-details-manager',
|
selector: 'app-details-manager',
|
||||||
@@ -35,20 +34,18 @@ import { Subject } from 'rxjs';
|
|||||||
encapsulation: ViewEncapsulation.None
|
encapsulation: ViewEncapsulation.None
|
||||||
})
|
})
|
||||||
export class DetailsComponent extends PageComponent implements OnInit, OnDestroy {
|
export class DetailsComponent extends PageComponent implements OnInit, OnDestroy {
|
||||||
|
private route = inject(ActivatedRoute);
|
||||||
|
private contentApi = inject(ContentApiService);
|
||||||
|
|
||||||
nodeId: string;
|
nodeId: string;
|
||||||
isLoading: boolean;
|
isLoading: boolean;
|
||||||
onDestroy$ = new Subject<boolean>();
|
|
||||||
activeTab = 1;
|
activeTab = 1;
|
||||||
|
|
||||||
constructor(private route: ActivatedRoute, private contentApi: ContentApiService) {
|
|
||||||
super();
|
|
||||||
}
|
|
||||||
|
|
||||||
ngOnInit(): void {
|
ngOnInit(): void {
|
||||||
super.ngOnInit();
|
super.ngOnInit();
|
||||||
|
|
||||||
this.isLoading = true;
|
this.isLoading = true;
|
||||||
const { route } = this;
|
const { data } = this.route.snapshot;
|
||||||
const { data } = route.snapshot;
|
|
||||||
this.title = data.title;
|
this.title = data.title;
|
||||||
|
|
||||||
this.route.params.subscribe((params) => {
|
this.route.params.subscribe((params) => {
|
||||||
@@ -82,8 +79,6 @@ export class DetailsComponent extends PageComponent implements OnInit, OnDestroy
|
|||||||
}
|
}
|
||||||
|
|
||||||
ngOnDestroy(): void {
|
ngOnDestroy(): void {
|
||||||
this.store.dispatch(new SetSelectedNodesAction([]));
|
super.ngOnDestroy();
|
||||||
this.onDestroy$.next();
|
|
||||||
this.onDestroy$.complete();
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user