mirror of
https://github.com/Alfresco/alfresco-ng2-components.git
synced 2025-07-24 17:32:15 +00:00
[ADF-4745] memory leak fixes (#4931)
* fix app-layout component * fix card-view component * fix cloud-layout service * code fixes * code fixes * even more fixes * even more fixes * lint fixes * test fixes * fix code * remove useless pipes * fix code owners * enable spellcheck for cloud components * update test * update test
This commit is contained in:
committed by
Eugenio Romano
parent
e2311ab045
commit
1abb9bfc89
@@ -45,7 +45,7 @@ import { SelectAppsDialogComponent } from '@alfresco/adf-process-services';
|
||||
|
||||
import { VersionManagerDialogAdapterComponent } from './version-manager-dialog-adapter.component';
|
||||
import { MetadataDialogAdapterComponent } from './metadata-dialog-adapter.component';
|
||||
import { Subscription, Subject } from 'rxjs';
|
||||
import { Subject } from 'rxjs';
|
||||
import { PreviewService } from '../../services/preview.service';
|
||||
import { debounceTime, takeUntil } from 'rxjs/operators';
|
||||
import { SearchEntry } from '@alfresco/js-api';
|
||||
@@ -201,9 +201,6 @@ export class FilesComponent implements OnInit, OnChanges, OnDestroy {
|
||||
displayEmptyMetadata = false;
|
||||
hyperlinkNavigation = false;
|
||||
|
||||
private onCreateFolder: Subscription;
|
||||
private onEditFolder: Subscription;
|
||||
|
||||
constructor(private notificationService: NotificationService,
|
||||
private uploadService: UploadService,
|
||||
private contentService: ContentService,
|
||||
@@ -264,13 +261,28 @@ export class FilesComponent implements OnInit, OnChanges, OnDestroy {
|
||||
});
|
||||
}
|
||||
|
||||
this.uploadService.fileUploadComplete.asObservable()
|
||||
.pipe(debounceTime(300))
|
||||
.subscribe((value) => this.onFileUploadEvent(value));
|
||||
this.uploadService.fileUploadDeleted.subscribe((value) => this.onFileUploadEvent(value));
|
||||
this.contentService.folderCreated.subscribe((value) => this.onFolderCreated(value));
|
||||
this.onCreateFolder = this.contentService.folderCreate.subscribe((value) => this.onFolderAction(value));
|
||||
this.onEditFolder = this.contentService.folderEdit.subscribe((value) => this.onFolderAction(value));
|
||||
this.uploadService.fileUploadComplete
|
||||
.pipe(
|
||||
debounceTime(300),
|
||||
takeUntil(this.onDestroy$)
|
||||
)
|
||||
.subscribe(value => this.onFileUploadEvent(value));
|
||||
|
||||
this.uploadService.fileUploadDeleted
|
||||
.pipe(takeUntil(this.onDestroy$))
|
||||
.subscribe(value => this.onFileUploadEvent(value));
|
||||
|
||||
this.contentService.folderCreated
|
||||
.pipe(takeUntil(this.onDestroy$))
|
||||
.subscribe(value => this.onFolderCreated(value));
|
||||
|
||||
this.contentService.folderCreate
|
||||
.pipe(takeUntil(this.onDestroy$))
|
||||
.subscribe(value => this.onFolderAction(value));
|
||||
|
||||
this.contentService.folderEdit
|
||||
.pipe(takeUntil(this.onDestroy$))
|
||||
.subscribe(value => this.onFolderAction(value));
|
||||
|
||||
this.contentMetadataService.error
|
||||
.pipe(takeUntil(this.onDestroy$))
|
||||
@@ -286,9 +298,6 @@ export class FilesComponent implements OnInit, OnChanges, OnDestroy {
|
||||
}
|
||||
|
||||
ngOnDestroy() {
|
||||
this.onCreateFolder.unsubscribe();
|
||||
this.onEditFolder.unsubscribe();
|
||||
|
||||
this.onDestroy$.next(true);
|
||||
this.onDestroy$.complete();
|
||||
}
|
||||
@@ -592,7 +601,7 @@ export class FilesComponent implements OnInit, OnChanges, OnDestroy {
|
||||
width: '400px'
|
||||
});
|
||||
|
||||
dialogInstance.componentInstance.error.subscribe((message) => {
|
||||
dialogInstance.componentInstance.error.subscribe((message: string) => {
|
||||
this.notificationService.openSnackMessage(message);
|
||||
});
|
||||
}
|
||||
|
Reference in New Issue
Block a user