mirror of
https://github.com/Alfresco/alfresco-ng2-components.git
synced 2025-07-24 17:32:15 +00:00
[ACA-4202] - refreshing the preview when version has changed (#6763)
This commit is contained in:
@@ -260,7 +260,11 @@ export class ViewerComponent implements OnChanges, OnInit, OnDestroy {
|
||||
|
||||
ngOnInit() {
|
||||
this.apiService.nodeUpdated.pipe(
|
||||
filter((node) => node && node.id === this.nodeId && node.name !== this.fileName),
|
||||
filter((node) => {
|
||||
return node && node.id === this.nodeId &&
|
||||
(node.name !== this.fileName ||
|
||||
this.getNodeVersionProperty(this.nodeEntry.entry) !== this.getNodeVersionProperty(node));
|
||||
}),
|
||||
takeUntil(this.onDestroy$)
|
||||
).subscribe((node) => this.onNodeUpdated(node));
|
||||
|
||||
@@ -284,6 +288,10 @@ export class ViewerComponent implements OnChanges, OnInit, OnDestroy {
|
||||
});
|
||||
}
|
||||
|
||||
private getNodeVersionProperty(node: Node): string {
|
||||
return node?.properties['cm:versionLabel'] ?? '';
|
||||
}
|
||||
|
||||
ngOnDestroy() {
|
||||
this.onDestroy$.next(true);
|
||||
this.onDestroy$.complete();
|
||||
|
Reference in New Issue
Block a user