mirror of
https://github.com/zitadel/zitadel.git
synced 2025-01-06 13:57:41 +00:00
fix(console): header image fallback (#3735)
fix: fallback icon in header Co-authored-by: Livio Amstutz <livio.a@gmail.com>
This commit is contained in:
parent
f9e9b4b64b
commit
47feced1cb
@ -10,20 +10,20 @@
|
||||
alt="home logo"
|
||||
*ngIf="isDarkTheme; else customlighttheme"
|
||||
[src]="labelpolicy?.iconUrlDark ? labelpolicy.iconUrlDark : './assets/images/zitadel-logo-solo-light.svg'"
|
||||
onerror="this.src='./assets/images/zitadel-logo-solo-light.svg';this.onerror='';"
|
||||
(error)="errorHandler($event, './assets/images/zitadel-logo-solo-light.svg')"
|
||||
/>
|
||||
<ng-template #customlighttheme>
|
||||
<img
|
||||
alt="home logo"
|
||||
class="logo"
|
||||
[src]="labelpolicy?.iconUrl ? labelpolicy.iconUrl : './assets/images/zitadel-logo-solo-dark.svg'"
|
||||
onerror="this.src='./assets/images/zitadel-logo-solo-dark.svg';this.onerror='';"
|
||||
(error)="errorHandler($event, './assets/images/zitadel-logo-solo-dark.svg')"
|
||||
/>
|
||||
</ng-template>
|
||||
</a>
|
||||
|
||||
<ng-template #defaultHome>
|
||||
<a *ngIf="org" class="title" [routerLink]="['/']">
|
||||
<a class="title" [routerLink]="['/']">
|
||||
<img
|
||||
class="logo"
|
||||
alt="zitadel logo"
|
||||
@ -31,7 +31,7 @@
|
||||
src="./assets/images/zitadel-logo-solo-light.svg"
|
||||
/>
|
||||
<ng-template #lighttheme>
|
||||
<img alt="zitadel logo" class="logo" src="../assets/images/zitadel-logo-solo-dark.svg" />
|
||||
<img alt="zitadel logo" class="logo" src="./assets/images/zitadel-logo-solo-dark.svg" />
|
||||
</ng-template>
|
||||
</a>
|
||||
</ng-template>
|
||||
|
@ -67,6 +67,10 @@ export class HeaderComponent implements OnDestroy {
|
||||
return this.router.url === '/users/me';
|
||||
}
|
||||
|
||||
public errorHandler(event: any, fallbackSrc: string) {
|
||||
(event.target as HTMLImageElement).src = fallbackSrc;
|
||||
}
|
||||
|
||||
public get isOnInstance(): boolean {
|
||||
const pages: string[] = [
|
||||
'/instance',
|
||||
|
Loading…
x
Reference in New Issue
Block a user