Client: Replaced get favicon to new handler
This commit is contained in:
parent
8031b1a749
commit
fbbfd019db
@ -14,17 +14,16 @@
|
||||
-->
|
||||
<link
|
||||
id="favicon"
|
||||
rel="shortcut icon"
|
||||
sizes="any"
|
||||
href="/storage/whitelabel/root/favicon.png"
|
||||
onerror="this.onerror=null;this.href='favicon.ico';"
|
||||
rel="icon"
|
||||
type="image/x-icon"
|
||||
href="/logo.ashx?logotype=3"
|
||||
/>
|
||||
<link
|
||||
<!-- <link
|
||||
id="favicon-icon"
|
||||
rel="icon"
|
||||
href="/storage/whitelabel/root/favicon.png"
|
||||
onerror="this.onerror=null;this.href='favicon.ico';"
|
||||
/>
|
||||
/> -->
|
||||
|
||||
<link rel="manifest" href="/manifest.json" />
|
||||
<!-- Tell the browser it's a PWA -->
|
||||
@ -49,7 +48,7 @@
|
||||
content="app-id=com.onlyoffice.documents"
|
||||
/>
|
||||
|
||||
<link
|
||||
<!-- <link
|
||||
rel="apple-touch-icon"
|
||||
href="/storage/whitelabel/root/favicon.png"
|
||||
onerror="this.onerror=null;this.href='favicon.ico';"
|
||||
@ -58,7 +57,7 @@
|
||||
rel="android-touch-icon"
|
||||
href="/storage/whitelabel/root/favicon.png"
|
||||
onerror="this.onerror=null;this.href='favicon.ico';"
|
||||
/>
|
||||
/> -->
|
||||
|
||||
<!-- <%= htmlWebpackPlugin.options.custom %> -->
|
||||
|
||||
|
@ -33,7 +33,6 @@ import { useTranslation } from "react-i18next";
|
||||
import { isMobile, isIOS, isFirefox } from "react-device-detect";
|
||||
import { toast as toastify } from "react-toastify";
|
||||
|
||||
import { setFavicon } from "@docspace/shared/utils/favicon";
|
||||
import { Portal } from "@docspace/shared/components/portal";
|
||||
import { SnackBar } from "@docspace/shared/components/snackbar";
|
||||
import { Toast, toastr } from "@docspace/shared/components/toast";
|
||||
@ -130,11 +129,6 @@ const Shell = ({ items = [], page = "home", ...rest }) => {
|
||||
moment.locale(language);
|
||||
}, []);
|
||||
|
||||
useEffect(() => {
|
||||
if (!whiteLabelLogoUrls) return;
|
||||
setFavicon(whiteLabelLogoUrls);
|
||||
}, [whiteLabelLogoUrls]);
|
||||
|
||||
useEffect(() => {
|
||||
socketHelper.emit({
|
||||
command: "subscribe",
|
||||
|
@ -36,7 +36,6 @@ import AppLoader from "@docspace/shared/components/app-loader";
|
||||
import Error403 from "@docspace/shared/components/errors/Error403";
|
||||
|
||||
import tryRedirectTo from "@docspace/shared/utils/tryRedirectTo";
|
||||
import { setFavicon } from "@docspace/shared/utils/favicon";
|
||||
|
||||
import "@docspace/shared/styles/custom.scss";
|
||||
|
||||
@ -75,11 +74,6 @@ const App = observer(() => {
|
||||
initData();
|
||||
}, []);
|
||||
|
||||
useEffect(() => {
|
||||
if (!whiteLabelLogoUrls) return;
|
||||
setFavicon(whiteLabelLogoUrls);
|
||||
}, [whiteLabelLogoUrls]);
|
||||
|
||||
useEffect(() => {
|
||||
if (userTheme) setTheme(userTheme);
|
||||
}, [userTheme]);
|
||||
|
@ -1,28 +0,0 @@
|
||||
import { getLogoFromPath } from "./common";
|
||||
import { TWhiteLabel } from "./whiteLabelHelper";
|
||||
|
||||
export const setFavicon = (whiteLabelLogoUrls: TWhiteLabel[]) => {
|
||||
if (!whiteLabelLogoUrls) return;
|
||||
const favicon = getLogoFromPath(whiteLabelLogoUrls[2]?.path?.light);
|
||||
|
||||
if (!favicon) return;
|
||||
|
||||
const link: HTMLLinkElement | null = document.querySelector("#favicon-icon");
|
||||
if (link) link.href = favicon;
|
||||
|
||||
const shortcutIconLink: HTMLLinkElement | null =
|
||||
document.querySelector("#favicon");
|
||||
|
||||
if (shortcutIconLink) shortcutIconLink.href = favicon;
|
||||
|
||||
const appleIconLink: HTMLLinkElement | null = document.querySelector(
|
||||
"link[rel~='apple-touch-icon']",
|
||||
);
|
||||
|
||||
if (appleIconLink) appleIconLink.href = favicon;
|
||||
|
||||
const androidIconLink: HTMLLinkElement | null = document.querySelector(
|
||||
"link[rel~='android-touch-icon']",
|
||||
);
|
||||
if (androidIconLink) androidIconLink.href = favicon;
|
||||
};
|
Loading…
Reference in New Issue
Block a user