From 7ccbe61a1b9c8d59214fa3357bece49d4917f19d Mon Sep 17 00:00:00 2001 From: Forget Date: Mon, 16 Dec 2024 14:50:16 +0800 Subject: [PATCH 1/3] =?UTF-8?q?feat:=20=E4=BF=AE=E5=A4=8D=E8=A7=86?= =?UTF-8?q?=E5=9B=BE=E6=9B=B4=E6=96=B0=E5=A4=9A=E6=AC=A1=E6=B3=A8=E5=85=A5?= =?UTF-8?q?=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/App.tsx | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/src/App.tsx b/src/App.tsx index a39a267..fe7e3cb 100644 --- a/src/App.tsx +++ b/src/App.tsx @@ -1,5 +1,5 @@ import { useQuery } from "@tanstack/react-query" -import React, { useCallback } from "react" +import React, { use, useCallback,useEffect } from "react" import { useTranslation } from "react-i18next" import { Route, BrowserRouter as Router, Routes } from "react-router-dom" @@ -55,6 +55,12 @@ const App: React.FC = () => { }) }, []) + useEffect(() => { + if (settingData?.data?.custom_code) { + InjectContext(settingData?.data?.custom_code) + } + },[settingData?.data?.custom_code]) + if (error) { return } @@ -67,9 +73,7 @@ const App: React.FC = () => { i18n.changeLanguage(settingData?.data?.language) } - if (settingData?.data?.custom_code) { - InjectContext(settingData?.data?.custom_code) - } + const customBackgroundImage = // @ts-expect-error ShowNetTransfer is a global variable From 68e10f5eaafdf32154fcc09a4c01b9c28380d1fe Mon Sep 17 00:00:00 2001 From: Forget Date: Mon, 16 Dec 2024 14:54:35 +0800 Subject: [PATCH 2/3] feat: code format --- src/App.tsx | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/src/App.tsx b/src/App.tsx index fe7e3cb..5d9904b 100644 --- a/src/App.tsx +++ b/src/App.tsx @@ -1,8 +1,7 @@ import { useQuery } from "@tanstack/react-query" -import React, { use, useCallback,useEffect } from "react" +import React, { useCallback,useEffect } from "react" import { useTranslation } from "react-i18next" import { Route, BrowserRouter as Router, Routes } from "react-router-dom" - import Footer from "./components/Footer" import Header from "./components/Header" import { fetchSetting } from "./lib/nezha-api" From c20562632416e66e1f079e9a88ccdadcdf832fd5 Mon Sep 17 00:00:00 2001 From: dr-forget Date: Mon, 16 Dec 2024 06:55:08 +0000 Subject: [PATCH 3/3] chore: auto-fix linting and formatting issues --- bun.lockb | Bin 189199 -> 189199 bytes src/App.tsx | 13 ++++++------- 2 files changed, 6 insertions(+), 7 deletions(-) diff --git a/bun.lockb b/bun.lockb index 627e74d3f5fb5e2df38de54c6f20049021859d32..7f9935c8cc0da34657fdcc20d525a93b159515a4 100755 GIT binary patch delta 25 hcmeA_#@&C6yI~7s?^AZhI72-{J>%_Do-$Vd1ptM43TOZT delta 25 dcmeA_#@&C6yI~7s?^AXr1~Aw@ { }, []) useEffect(() => { - if (settingData?.data?.custom_code) { - InjectContext(settingData?.data?.custom_code) - } - },[settingData?.data?.custom_code]) + if (settingData?.data?.custom_code) { + InjectContext(settingData?.data?.custom_code) + } + }, [settingData?.data?.custom_code]) if (error) { return @@ -72,8 +73,6 @@ const App: React.FC = () => { i18n.changeLanguage(settingData?.data?.language) } - - const customBackgroundImage = // @ts-expect-error ShowNetTransfer is a global variable (window.CustomBackgroundImage as string) !== "" ? window.CustomBackgroundImage : undefined