DM-339: Fixed red border not disappearing.

This commit is contained in:
Nicoleta Panaghiu 2023-08-23 14:26:35 +03:00
parent 14914b10b2
commit 18197c7e3f
2 changed files with 12 additions and 12 deletions

View File

@ -166,6 +166,7 @@ export class FilePreviewScreenComponent
);
effect(() => {
this.state.shouldUpdate();
if (this._documentViewer.pageComplete()) {
this.#setExcludedPageStyles();
}
@ -625,19 +626,17 @@ export class FilePreviewScreenComponent
#setExcludedPageStyles() {
const file = this._filesMapService.get(this.dossierId, this.fileId);
setTimeout(() => {
const iframeDoc = this.pdf.instance.UI.iframeWindow.document;
const currentPage = this.pdf.currentPage();
const elementId = `pageWidgetContainer${currentPage}`;
const pageContainer = iframeDoc.getElementById(elementId);
if (pageContainer) {
if (file.excludedPages.includes(currentPage)) {
pageContainer.classList.add('excluded-page');
} else {
pageContainer.classList.remove('excluded-page');
}
const iframeDoc = this.pdf.instance.UI.iframeWindow.document;
const currentPage = this.pdf.currentPage();
const elementId = `pageWidgetContainer${currentPage}`;
const pageContainer = iframeDoc.getElementById(elementId);
if (pageContainer) {
if (file.excludedPages.includes(currentPage)) {
pageContainer.classList.add('excluded-page');
} else {
pageContainer.classList.remove('excluded-page');
}
}, 100);
}
}
#subscribeToFileUpdates(): void {

View File

@ -44,6 +44,7 @@ export class FilePreviewStateService {
readonly dossierId = getParam(DOSSIER_ID);
readonly dossierTemplateId = getParam(DOSSIER_TEMPLATE_ID);
readonly fileId = getParam(FILE_ID);
readonly shouldUpdate = computed(() => this.file().excludedPages);
constructor(
private readonly _permissionsService: PermissionsService,