feat: disable custom background button

This commit is contained in:
hamster1963
2025-01-17 18:07:39 +08:00
parent b1c5b6e0a8
commit 38be1e9a10
18 changed files with 99 additions and 99 deletions
+2 -4
View File
@@ -6,6 +6,7 @@ import { Route, BrowserRouter as Router, Routes } from "react-router-dom"
import ErrorBoundary from "./components/ErrorBoundary"
import Footer from "./components/Footer"
import Header, { RefreshToast } from "./components/Header"
import { useBackground } from "./hooks/use-background"
import { useTheme } from "./hooks/use-theme"
import { InjectContext } from "./lib/inject"
import { fetchSetting } from "./lib/nezha-api"
@@ -25,6 +26,7 @@ const App: React.FC = () => {
const { i18n } = useTranslation()
const { setTheme } = useTheme()
const [isCustomCodeInjected, setIsCustomCodeInjected] = useState(false)
const { backgroundImage: customBackgroundImage } = useBackground()
// 检测是否强制指定了主题颜色
const forceTheme =
@@ -60,10 +62,6 @@ const App: React.FC = () => {
i18n.changeLanguage(settingData?.data?.config?.language)
}
const customBackgroundImage =
// @ts-expect-error CustomBackgroundImage is a global variable
(window.CustomBackgroundImage as string) !== "" ? window.CustomBackgroundImage : undefined
const customMobileBackgroundImage =
// @ts-expect-error CustomMobileBackgroundImage is a global variable
(window.CustomMobileBackgroundImage as string) !== "" ? window.CustomMobileBackgroundImage : undefined