From ffd2aef78e6687e333016f82ac3056dc96bec7c5 Mon Sep 17 00:00:00 2001 From: Valentin Date: Fri, 29 Oct 2021 13:52:50 +0300 Subject: [PATCH] checked when 'canMarkPagesAsViewed' value is changing on fileChanged$ subscription called handlePageRead when that is happening --- .../components/page-indicator/page-indicator.component.ts | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/apps/red-ui/src/app/modules/dossier/components/page-indicator/page-indicator.component.ts b/apps/red-ui/src/app/modules/dossier/components/page-indicator/page-indicator.component.ts index 2c9d39c7d..29ea3b674 100644 --- a/apps/red-ui/src/app/modules/dossier/components/page-indicator/page-indicator.component.ts +++ b/apps/red-ui/src/app/modules/dossier/components/page-indicator/page-indicator.component.ts @@ -47,7 +47,10 @@ export class PageIndicatorComponent implements OnChanges, OnInit, OnDestroy { ngOnInit(): void { this._subscription = this._appStateService.fileChanged$.subscribe(() => { - this.canMarkPagesAsViewed = this._permissionService.canMarkPagesAsViewed(); + if (this.canMarkPagesAsViewed !== this._permissionService.canMarkPagesAsViewed()) { + this.canMarkPagesAsViewed = this._permissionService.canMarkPagesAsViewed(); + this._handlePageRead(); + } }); }