mirror of
https://github.com/aykhans/slash-e.git
synced 2025-04-20 22:07:15 +00:00
chore: update favicon with custom branding
This commit is contained in:
parent
87e251d6b0
commit
a7057f9e9f
@ -4,6 +4,7 @@ import { Outlet } from "react-router-dom";
|
||||
import DemoBanner from "@/components/DemoBanner";
|
||||
import { useWorkspaceStore } from "@/stores";
|
||||
import useNavigateTo from "./hooks/useNavigateTo";
|
||||
import { PlanType } from "./types/proto/api/v1/subscription_service";
|
||||
|
||||
function App() {
|
||||
const navigateTo = useNavigateTo();
|
||||
@ -26,6 +27,16 @@ function App() {
|
||||
document.body.insertAdjacentElement("beforeend", styleEl);
|
||||
}, [workspaceStore.setting.customStyle]);
|
||||
|
||||
useEffect(() => {
|
||||
const hasCustomBranding = workspaceStore.profile.plan === PlanType.PRO;
|
||||
if (!hasCustomBranding || !workspaceStore.setting.branding) {
|
||||
return;
|
||||
}
|
||||
|
||||
const favicon = document.querySelector("link[rel='icon']") as HTMLLinkElement;
|
||||
favicon.href = new TextDecoder().decode(workspaceStore.setting.branding);
|
||||
}, [workspaceStore.setting.branding]);
|
||||
|
||||
useEffect(() => {
|
||||
const root = document.documentElement;
|
||||
if (colorScheme === "light") {
|
||||
|
Loading…
x
Reference in New Issue
Block a user