RED-6917: Fix page navigation while search is active
This commit is contained in:
parent
d97a94143b
commit
3345c56fa1
@ -257,7 +257,6 @@ export class FilePreviewScreenComponent
|
||||
}
|
||||
}
|
||||
|
||||
await this._stampService.stampPDF();
|
||||
this.#rebuildFilters();
|
||||
}
|
||||
|
||||
@ -602,7 +601,9 @@ export class FilePreviewScreenComponent
|
||||
.pipe(tap(() => this._handleDeletedFile()))
|
||||
.subscribe();
|
||||
|
||||
this.addActiveScreenSubscription = combineLatest([this._viewModeService.viewMode$, this.state.file$])
|
||||
const viewModeChanged$ = this._viewModeService.viewMode$.pipe(tap(() => this._stampService.stampPDF().then()));
|
||||
|
||||
this.addActiveScreenSubscription = combineLatest([viewModeChanged$, this.state.file$])
|
||||
.pipe(
|
||||
filter(([viewMode, file]) => viewMode === ViewModes.TEXT_HIGHLIGHTS && !file.hasHighlights),
|
||||
tap(() => this._viewModeService.switchToStandard()),
|
||||
|
||||
@ -31,6 +31,7 @@ export class StampService {
|
||||
const file = this._state.file;
|
||||
const allPages = [...Array(file.numberOfPages).keys()].map(page => page + 1);
|
||||
|
||||
await pdfDoc.lock();
|
||||
try {
|
||||
await clearStamps(pdfDoc, this._pdf.PDFNet, allPages, this._licenseService.activeLicenseKey);
|
||||
} catch (e) {
|
||||
@ -47,7 +48,8 @@ export class StampService {
|
||||
await this._stampExcludedPages(pdfDoc, file.excludedPages);
|
||||
}
|
||||
|
||||
this._documentViewer.refreshAndUpdateView();
|
||||
this._documentViewer.refreshAndUpdateView(Array.from({ length: await pdfDoc.getPageCount() }, (_x, i) => i + 1));
|
||||
await pdfDoc.unlock();
|
||||
}
|
||||
|
||||
private async _stampExcludedPages(document: PDFNet.PDFDoc, excludedPages: number[]): Promise<void> {
|
||||
|
||||
@ -153,11 +153,11 @@ export class REDDocumentViewer {
|
||||
}
|
||||
}
|
||||
|
||||
refreshAndUpdateView() {
|
||||
refreshAndUpdateView(visiblePages: number[]) {
|
||||
this.#document.refreshAll();
|
||||
// do not adjust this page if is compare mode
|
||||
const currentPage = this.#document.getCurrentPage();
|
||||
this.#document.updateView([currentPage], currentPage);
|
||||
this.#document.updateView(visiblePages, currentPage);
|
||||
}
|
||||
|
||||
resetRotation(pages: number | number[] | string | string[]) {
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user