Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
57 changes: 29 additions & 28 deletions frontend/src/app/app.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -187,6 +187,7 @@ export class AppComponent {

if (!expirationToken) {
this.setUserLoggedIn(false);
this.setDefaultFavicon();
}

this.navigationTabs = {
Expand Down Expand Up @@ -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);
Comment on lines +327 to +330

Copilot AI Feb 20, 2026

Copy link

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).

Suggested change
const newLink = document.createElement('link');
newLink.rel = 'icon';
newLink.href = whiteLabelSettings.favicon;
document.head.appendChild(newLink);
const head = document.head || document.getElementsByTagName('head')[0];
const existingIcons = head.querySelectorAll("link[rel~='icon']");
existingIcons.forEach((icon) => head.removeChild(icon));
const newLink = document.createElement('link');
newLink.rel = 'icon';
newLink.type = 'image/png';
newLink.href = whiteLabelSettings.favicon;
head.appendChild(newLink);

Copilot uses AI. Check for mistakes.
} 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) => {
Expand Down Expand Up @@ -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

Copilot AI Feb 20, 2026

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

setDefaultFavicon() unconditionally appends three new icon elements each time it’s called, which can create duplicates (it’s called both in ngOnInit when no token and again when whiteLabelSettings.favicon is missing). Consider de-duping by removing existing favicon links first or by reusing/storing references (e.g., with ids) and updating hrefs instead of appending repeatedly.

Copilot uses AI. Check for mistakes.
}
}
Binary file modified frontend/src/assets/favicon-16x16.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified frontend/src/assets/favicon-32x32.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified frontend/src/assets/favicon.ico
Binary file not shown.
2 changes: 1 addition & 1 deletion frontend/src/assets/favicon.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
2 changes: 1 addition & 1 deletion frontend/src/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -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

Copilot AI Feb 20, 2026

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The favicon tags are still inside an HTML comment (opened at line 9). As written, browsers will ignore all three favicon links, so this change won’t actually “uncomment” them. Remove the surrounding (or move the comment markers so the tags are not commented) to ensure favicons load on the login/registration pages.

Copilot uses AI. Check for mistakes.
Comment on lines 9 to +11

Copilot AI Feb 20, 2026

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

PR description mentions uncommenting favicon links in both index.html and index.saas.html, but index.saas.html still has the favicon tags commented out. If SaaS builds use index.saas.html, favicons still won’t appear there; please apply the same change to index.saas.html (or update the PR description if it’s not needed).

Copilot uses AI. Check for mistakes.
</head>
<body style="background-color: #191919; color: #ffffff;">
<app-root class="mainLayout mat-typography"></app-root>
Expand Down
Loading