mirror of
https://github.com/paperless-ngx/paperless-ngx.git
synced 2025-12-18 04:26:35 +01:00
configuration option for type of PDF viewer fixes #337
This commit is contained in:
parent
769356733a
commit
a008dff368
11 changed files with 165 additions and 91 deletions
19
src-ui/src/app/pipes/safe.pipe.ts
Normal file
19
src-ui/src/app/pipes/safe.pipe.ts
Normal file
|
|
@ -0,0 +1,19 @@
|
|||
import { Pipe, PipeTransform } from '@angular/core';
|
||||
import { DomSanitizer } from '@angular/platform-browser';
|
||||
|
||||
@Pipe({
|
||||
name: 'safe'
|
||||
})
|
||||
export class SafePipe implements PipeTransform {
|
||||
|
||||
constructor(private sanitizer: DomSanitizer) { }
|
||||
|
||||
transform(url) {
|
||||
if (url == null) {
|
||||
return this.sanitizer.bypassSecurityTrustResourceUrl("")
|
||||
} else {
|
||||
return this.sanitizer.bypassSecurityTrustResourceUrl(url);
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue