mirror of
https://github.com/andwati/dokploy.git
synced 2026-11-19 02:15:17 +00:00
fix(ui): remove early return to render theme-aware favicon immediately
The previous implementation returned null when config was not yet loaded, preventing the theme-aware favicon from rendering during initial page load. Now uses optional chaining (config?.metaTitle, config?.customCss) throughout so the <link rel="icon"> always renders with the correct theme-aware favicon regardless of config loading state. Fixes P1 issue from code review.
This commit is contained in:
@@ -16,16 +16,14 @@ export function WhitelabelingProvider() {
|
|||||||
: resolvedTheme === "light" ? "/icon-light.svg"
|
: resolvedTheme === "light" ? "/icon-light.svg"
|
||||||
: "/icon.svg");
|
: "/icon.svg");
|
||||||
|
|
||||||
if (!config) return null;
|
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<>
|
<>
|
||||||
<Head>
|
<Head>
|
||||||
{config.metaTitle && <title>{config.metaTitle}</title>}
|
{config?.metaTitle && <title>{config.metaTitle}</title>}
|
||||||
<link rel="icon" href={faviconHref} key="app-favicon" />
|
<link rel="icon" href={faviconHref} key="app-favicon" />
|
||||||
</Head>
|
</Head>
|
||||||
|
|
||||||
{config.customCss && (
|
{config?.customCss && (
|
||||||
<style
|
<style
|
||||||
id="whitelabeling-styles"
|
id="whitelabeling-styles"
|
||||||
dangerouslySetInnerHTML={{
|
dangerouslySetInnerHTML={{
|
||||||
|
|||||||
Reference in New Issue
Block a user