-
-
Notifications
You must be signed in to change notification settings - Fork 18
fix: show favicon on login/registration pages and update color to blue #1615
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
35183e1
e92a945
40f2066
8380b15
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -187,6 +187,7 @@ export class AppComponent { | |
|
|
||
| if (!expirationToken) { | ||
| this.setUserLoggedIn(false); | ||
| this.setDefaultFavicon(); | ||
| } | ||
|
|
||
| this.navigationTabs = { | ||
|
|
@@ -323,35 +324,12 @@ export class AppComponent { | |
| this.whiteLabelSettingsLoaded = true; | ||
|
|
||
| if (whiteLabelSettings.favicon) { | ||
| const link: HTMLLinkElement | null = document.querySelector("link[rel*='icon']"); | ||
| if (link) { | ||
| link.href = whiteLabelSettings.favicon; | ||
| } else { | ||
| const newLink = document.createElement('link'); | ||
| newLink.rel = 'icon'; | ||
| newLink.href = whiteLabelSettings.favicon; | ||
| document.head.appendChild(newLink); | ||
| } | ||
| const newLink = document.createElement('link'); | ||
| newLink.rel = 'icon'; | ||
| newLink.href = whiteLabelSettings.favicon; | ||
| document.head.appendChild(newLink); | ||
| } else { | ||
| const faviconIco = document.createElement('link'); | ||
| faviconIco.rel = 'icon'; | ||
| faviconIco.type = 'image/x-icon'; | ||
| faviconIco.href = 'assets/favicon.ico'; | ||
|
|
||
| const favicon16 = document.createElement('link'); | ||
| favicon16.rel = 'icon'; | ||
| favicon16.type = 'image/png'; | ||
| favicon16.setAttribute('sizes', '16x16'); | ||
| favicon16.href = 'assets/favicon-16x16.png'; | ||
|
|
||
| const favicon32 = document.createElement('link'); | ||
| favicon32.rel = 'icon'; | ||
| favicon32.type = 'image/png'; | ||
| favicon32.setAttribute('sizes', '32x32'); | ||
| favicon32.href = 'assets/favicon-32x32.png'; | ||
|
|
||
| document.head.appendChild(favicon16); | ||
| document.head.appendChild(favicon32); | ||
| this.setDefaultFavicon(); | ||
| } | ||
| }); | ||
| this._uiSettings.getUiSettings().subscribe((settings) => { | ||
|
|
@@ -406,4 +384,27 @@ export class AppComponent { | |
| } | ||
| }); | ||
| } | ||
|
|
||
| private setDefaultFavicon() { | ||
| const faviconIco = document.createElement('link'); | ||
| faviconIco.rel = 'icon'; | ||
| faviconIco.type = 'image/x-icon'; | ||
| faviconIco.href = 'assets/favicon.ico'; | ||
|
|
||
| const favicon16 = document.createElement('link'); | ||
| favicon16.rel = 'icon'; | ||
| favicon16.type = 'image/png'; | ||
| favicon16.setAttribute('sizes', '16x16'); | ||
| favicon16.href = 'assets/favicon-16x16.png'; | ||
|
|
||
| const favicon32 = document.createElement('link'); | ||
| favicon32.rel = 'icon'; | ||
| favicon32.type = 'image/png'; | ||
| favicon32.setAttribute('sizes', '32x32'); | ||
| favicon32.href = 'assets/favicon-32x32.png'; | ||
|
|
||
| document.head.appendChild(faviconIco); | ||
| document.head.appendChild(favicon16); | ||
| document.head.appendChild(favicon32); | ||
|
Comment on lines
+388
to
+408
|
||
| } | ||
| } | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -8,7 +8,7 @@ | |
| <meta name="viewport" content="width=device-width, initial-scale=1"> | ||
| <!--<link rel="icon" type="image/x-icon" href="assets/favicon.ico"> | ||
| <link rel="icon" type="image/png" sizes="16x16" href="assets/favicon-16x16.png"> | ||
| <link rel="icon" type="image/png" sizes="32x32" href="assets/favicon-32x32.png"> --> | ||
| <link rel="icon" type="image/png" sizes="32x32" href="assets/favicon-32x32.png">--> | ||
|
Comment on lines
9
to
+11
|
||
| </head> | ||
| <body style="background-color: #191919; color: #ffffff;"> | ||
| <app-root class="mainLayout mat-typography"></app-root> | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
When a white-label favicon is present, this always appends a new without removing/updating existing icon links. That can leave multiple favicons in (including the defaults) and the chosen favicon may become browser-dependent. Prefer updating an existing icon link or clearing prior "link[rel~='icon']" entries before inserting the white-label favicon (and consider setting an appropriate type, e.g. image/png).