import { PDFDocumentProxy, PdfViewerModule } from 'ng2-pdf-viewer'
import { NgxBootstrapIconsModule } from 'ngx-bootstrap-icons'
import { DeviceDetectorService } from 'ngx-device-detector'
-import { BehaviorSubject, Observable, Subject } from 'rxjs'
+import { BehaviorSubject, Observable, of, Subject } from 'rxjs'
import {
+ catchError,
debounceTime,
distinctUntilChanged,
filter,
this.thumbUrl = this.documentsService.getThumbUrl(documentId)
this.documentsService
.get(documentId)
- .pipe(first())
+ .pipe(
+ catchError(() => {
+ // 404 is handled in the subscribe below
+ return of(null)
+ }),
+ first()
+ )
.subscribe({
next: (doc) => {
if (!doc) {
})
this.setupDirtyTracking(useDoc, doc)
},
- error: () =>
- this.router.navigate(['404'], {
- replaceUrl: true,
- }),
})
}