diff --git a/frontend/public/index.html b/frontend/public/index.html index 881bd7301..5102fc582 100644 --- a/frontend/public/index.html +++ b/frontend/public/index.html @@ -13,23 +13,5 @@
- diff --git a/frontend/src/index.js b/frontend/src/index.js index 0d0585f73..86b0876d2 100644 --- a/frontend/src/index.js +++ b/frontend/src/index.js @@ -7,6 +7,7 @@ import { GenericLoader } from "./components/generic-loader/GenericLoader"; import { LazyLoader } from "./components/widgets/lazy-loader/LazyLoader.jsx"; import { SocketProvider } from "./helpers/SocketContext.js"; import "./index.css"; +import config from "./config.js"; const enablePosthog = process.env.REACT_APP_ENABLE_POSTHOG; if (enablePosthog !== "false") { @@ -22,6 +23,20 @@ if (enablePosthog !== "false") { }); } +// Utility to set favicon +function setFavicon(url) { + let link = document.querySelector("link[rel~='icon']"); + if (!link) { + link = document.createElement("link"); + link.rel = "icon"; + document.head.appendChild(link); + } + link.href = url; +} + +// Call this after config is loaded +setFavicon(config.favicon); + const root = ReactDOM.createRoot(document.getElementById("root")); root.render(