Skip to content

Commit

Permalink
Only subscribe on first time
Browse files Browse the repository at this point in the history
  • Loading branch information
shamoon committed Oct 31, 2024
1 parent 382be39 commit 5355725
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/app/pdf-viewer/pdf-viewer.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -572,8 +572,9 @@ export class PdfViewerComponent

if (!this.pdfViewer._pages?.length) {
// the first time we wait until pages init
this.pageInitialized.subscribe(() => {
const sub = this.pageInitialized.subscribe(() => {
this.updateSize();
sub.unsubscribe();
})
} else {
this.updateSize();
Expand Down

0 comments on commit 5355725

Please sign in to comment.