Fix Bug 60169: Branding for Favicon does not apply
This commit is contained in:
parent
fc52606db3
commit
d9a6bdcb51
@ -164,6 +164,7 @@ const Shell = ({ items = [], page = "home", ...rest }) => {
|
||||
setSnackbarExist,
|
||||
userTheme,
|
||||
//user,
|
||||
whiteLabelLogoUrls,
|
||||
} = rest;
|
||||
|
||||
useEffect(() => {
|
||||
@ -174,6 +175,19 @@ const Shell = ({ items = [], page = "home", ...rest }) => {
|
||||
}
|
||||
}, []);
|
||||
|
||||
useEffect(() => {
|
||||
if (!whiteLabelLogoUrls) return;
|
||||
const favicon = whiteLabelLogoUrls[2]?.path?.light;
|
||||
|
||||
let link = document.querySelector("link[rel~='icon']");
|
||||
if (!link) {
|
||||
link = document.createElement("link");
|
||||
link.rel = "icon";
|
||||
document.getElementsByTagName("head")[0].appendChild(link);
|
||||
}
|
||||
link.href = favicon;
|
||||
}, [whiteLabelLogoUrls]);
|
||||
|
||||
useEffect(() => {
|
||||
socketHelper.emit({
|
||||
command: "subscribe",
|
||||
@ -494,6 +508,8 @@ const ShellWrapper = inject(({ auth, backup }) => {
|
||||
setSnackbarExist,
|
||||
socketHelper,
|
||||
setTheme,
|
||||
getWhiteLabelLogoUrls,
|
||||
whiteLabelLogoUrls,
|
||||
} = settingsStore;
|
||||
const isBase = settingsStore.theme.isBase;
|
||||
const { setPreparationPortalDialogVisible } = backup;
|
||||
@ -528,6 +544,7 @@ const ShellWrapper = inject(({ auth, backup }) => {
|
||||
? "Dark"
|
||||
: "Base"
|
||||
: auth?.userStore?.user?.theme,
|
||||
whiteLabelLogoUrls,
|
||||
};
|
||||
})(observer(Shell));
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user