This commit is contained in:
shamoon 2025-01-23 12:56:43 -08:00
parent 7df631f1b0
commit 90eb7c3713
No known key found for this signature in database
2 changed files with 3 additions and 2 deletions

View File

@ -170,7 +170,7 @@ describe('PreviewPopupComponent', () => {
dispatch: jest.fn(), dispatch: jest.fn(),
} as any) } as any)
const dispatchSpy = jest.spyOn(component.pdfViewer.eventBus, 'dispatch') const dispatchSpy = jest.spyOn(component.pdfViewer.eventBus, 'dispatch')
component.onViewerLoaded() component.onPageRendered()
expect(dispatchSpy).toHaveBeenCalledWith('find', { expect(dispatchSpy).toHaveBeenCalledWith('find', {
query: 'test', query: 'test',
caseSensitive: false, caseSensitive: false,

View File

@ -116,7 +116,8 @@ export class PreviewPopupComponent implements OnDestroy {
} }
} }
onViewerLoaded() { onPageRendered() {
// Only triggered by the pngx pdf viewer
if (this.documentService.searchQuery) { if (this.documentService.searchQuery) {
this.pdfViewer.eventBus.dispatch('find', { this.pdfViewer.eventBus.dispatch('find', {
query: this.documentService.searchQuery, query: this.documentService.searchQuery,