[desktop] Force <img> elements to use Angular HttpClient for image downloads (bypassing WebView)
This commit is contained in:
@@ -15,7 +15,7 @@
|
||||
</ng-container>
|
||||
|
||||
<header>
|
||||
<img [attr.src]="feature?.IconURL">
|
||||
<img [attr.src]="feature?.IconURL | httpImgSrc | async">
|
||||
|
||||
<span>
|
||||
{{ feature?.Name }}
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
<span *ngIf="!src && !isIgnoredProfile">
|
||||
{{letter}}
|
||||
</span>
|
||||
<img [attr.src]="src" *ngIf="!!src" loading="lazy">
|
||||
<img [attr.src]="src | httpImgSrc | async" *ngIf="!!src">
|
||||
<svg *ngIf="!src && isIgnoredProfile" xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 24 24"
|
||||
stroke-width="1.5" stroke="currentColor" class="w-full h-full text-gray-700">
|
||||
<path stroke-linecap="round" stroke-linejoin="round"
|
||||
|
||||
@@ -2,10 +2,12 @@ import { CommonModule } from "@angular/common";
|
||||
import { NgModule } from "@angular/core";
|
||||
import { AppIconComponent } from "./app-icon";
|
||||
import { AppIconResolver, DefaultIconResolver } from "./app-icon-resolver";
|
||||
import { CommonPipesModule } from "../pipes/common-pipes.module";
|
||||
|
||||
@NgModule({
|
||||
imports: [
|
||||
CommonModule
|
||||
CommonModule,
|
||||
CommonPipesModule,
|
||||
],
|
||||
declarations: [
|
||||
AppIconComponent,
|
||||
|
||||
@@ -245,7 +245,7 @@ export class AppIconComponent implements OnInit, OnDestroy {
|
||||
if (!!profile.Icons?.length) {
|
||||
const firstIcon = profile.Icons[0];
|
||||
|
||||
console.log(`profile ${profile.Name} has icon of from source ${firstIcon.Source} stored in ${firstIcon.Type}`)
|
||||
console.log(`profile '${profile.Name}' has icon of from source '${firstIcon.Source}' stored in '${firstIcon.Type}'`)
|
||||
|
||||
switch (firstIcon.Type) {
|
||||
case 'database':
|
||||
@@ -292,7 +292,7 @@ export class AppIconComponent implements OnInit, OnDestroy {
|
||||
icon = '';
|
||||
}
|
||||
if (icon !== '') {
|
||||
this.src = this.sanitzier.bypassSecurityTrustUrl(icon);
|
||||
this.src = icon; // this.src = this.sanitzier.bypassSecurityTrustUrl(icon);
|
||||
this.color = 'unset';
|
||||
} else {
|
||||
this.src = '';
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
<h1 class="flex flex-row gap-2 items-center">
|
||||
<img
|
||||
[src]="iconObjectURL"
|
||||
[src]="iconObjectURL | httpImgSrc | async"
|
||||
*ngIf="imageError === null && !!iconData"
|
||||
class="w-8 h-8 rounded-full border border-gray-400"
|
||||
/>
|
||||
@@ -85,7 +85,7 @@
|
||||
</div>
|
||||
|
||||
<img
|
||||
[src]="iconObjectURL"
|
||||
[src]="iconObjectURL | httpImgSrc | async"
|
||||
*ngIf="imageError === null && !!iconData"
|
||||
class="w-12 h-12 rounded-full border border-gray-400"
|
||||
/>
|
||||
|
||||
Reference in New Issue
Block a user