Skip to content

Infisical is the open-source platform for securing secrets, certificates, access, and AI Agents.

cleanup favicon

x032205995e1d594657
diff --git a/frontend/src/pages/public/ViewSharedSecretByIDPage/ViewSharedSecretByIDPage.tsx b/frontend/src/pages/public/ViewSharedSecretByIDPage/ViewSharedSecretByIDPage.tsx
index ca3e480216..cf2763de2e 100644
--- a/frontend/src/pages/public/ViewSharedSecretByIDPage/ViewSharedSecretByIDPage.tsx
+++ b/frontend/src/pages/public/ViewSharedSecretByIDPage/ViewSharedSecretByIDPage.tsx
@@ -188,9 +188,11 @@ export const ViewSharedSecretByIDPage = () => {
}, [brandingTheme]);
useEffect(() => {
- if (!faviconUrl) return;
+ if (!faviconUrl) return undefined;
const existingLink = document.querySelector("link[rel='icon']") as HTMLLinkElement | null;
+ const originalHref = existingLink?.href;
+
if (existingLink) {
existingLink.href = faviconUrl;
} else {
@@ -199,6 +201,12 @@ export const ViewSharedSecretByIDPage = () => {
link.href = faviconUrl;
document.head.appendChild(link);
}
+
+ return () => {
+ if (existingLink && originalHref) {
+ existingLink.href = originalHref;
+ }
+ };
}, [faviconUrl]);
if (isPending) {