mirror of
https://code.equilibrium.co.ao/ITO/doneit-web.git
synced 2026-04-18 20:47:54 +00:00
add sanitizer.bypassSecurityTrustUrl
This commit is contained in:
@@ -11,6 +11,7 @@ import { environment } from 'src/environments/environment';
|
||||
import { Storage } from '@ionic/storage';
|
||||
import { ChatController } from './controller/chat';
|
||||
import { register } from 'swiper/element/bundle';
|
||||
import { DomSanitizer } from '@angular/platform-browser';
|
||||
|
||||
const CUSTOM_DATE_FORMATS: NgxMatDateFormats = {
|
||||
parse: {
|
||||
@@ -39,13 +40,15 @@ export class AppComponent {
|
||||
private statusBar: StatusBar,
|
||||
public ThemeService: ThemeService,
|
||||
private storage: Storage,
|
||||
private ChatSystemService: ChatSystemService
|
||||
private ChatSystemService: ChatSystemService,
|
||||
private sanitizer: DomSanitizer
|
||||
) {
|
||||
|
||||
window["sanitizer"] = this.sanitizer
|
||||
this.initializeApp();
|
||||
this.storage.set('version', environment.version).then(() => {})
|
||||
ChatController.ChatSystemService = this.ChatSystemService
|
||||
|
||||
|
||||
}
|
||||
|
||||
/* requestPermission() {
|
||||
@@ -70,7 +73,7 @@ export class AppComponent {
|
||||
initializeApp() {
|
||||
this.platform.ready().then(() => {
|
||||
this.statusBar.styleDefault();
|
||||
|
||||
|
||||
if (this.platform.is("tablet")) {
|
||||
window.screen.orientation.unlock();
|
||||
} else if( this.platform.is("mobile")) {
|
||||
|
||||
@@ -115,17 +115,19 @@ export class PublicationAttachmentEntity {
|
||||
}
|
||||
|
||||
fixFileBase64() {
|
||||
//const sanitizer : DomSanitizer = window["sanitizer"]
|
||||
const sanitizer : DomSanitizer = window["sanitizer"]
|
||||
|
||||
if(this.FileType == 'image' ) {
|
||||
if(!this.Base64.startsWith('data:')) {
|
||||
this.url = 'data:image/jpg;base64,' + this.Base64
|
||||
// this.url = sanitizer.bypassSecurityTrustUrl('data:image/jpg;base64,' + this.Base64) as any
|
||||
} else {
|
||||
this.url = this.Base64
|
||||
}
|
||||
} else if (this.FileType == 'video' ) {
|
||||
if(!this.Base64.startsWith('data:') && !this.Base64.startsWith('http')) {
|
||||
this.url = 'data:video/mp4;base64,' + this.Base64
|
||||
// this.url = sanitizer.bypassSecurityTrustUrl('data:video/mp4;base64,' + this.Base64) as any
|
||||
} else {
|
||||
this.url = this.Base64
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user