fixed cleanup of annotations after exclude/include

This commit is contained in:
Timo Bejan 2022-01-18 14:25:27 +02:00
parent d2aaa46522
commit 439b43ae0d

View File

@ -466,7 +466,16 @@ export class FilePreviewScreenComponent extends AutoUnsubscribe implements OnIni
}
private async _reloadFile(file: File): Promise<void> {
const previousFile = this.fileData?.file;
await this._loadFileData(file);
const fileHasBeenExcludedOrIncluded = previousFile?.excluded !== this.fileData?.file?.excluded;
const excludedPagesHaveChanged = JSON.stringify(previousFile?.excludedPages) !== JSON.stringify(this.fileData?.file?.excludedPages);
if (fileHasBeenExcludedOrIncluded || excludedPagesHaveChanged) {
await this._deleteAnnotations();
await this._cleanupAndRedrawAnnotations();
}
await this._stampPDF();
}