diff --git a/bun.lockb b/bun.lockb index 627e74d..7f9935c 100755 Binary files a/bun.lockb and b/bun.lockb differ diff --git a/src/App.tsx b/src/App.tsx index a39a267..65a261a 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, { 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,10 +73,6 @@ 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 (window.CustomBackgroundImage as string) !== "" ? window.CustomBackgroundImage : undefined