From 37c2428f499ec6db61e0d70c25255f9cf91b853a Mon Sep 17 00:00:00 2001 From: xuvjso Date: Sun, 14 Dec 2025 10:01:46 +0800 Subject: [PATCH] fix: head state not updated when using config.yaml as current profile (#5827) --- src/components/proxy/use-head-state.ts | 10 +--------- 1 file changed, 1 insertion(+), 9 deletions(-) diff --git a/src/components/proxy/use-head-state.ts b/src/components/proxy/use-head-state.ts index 593290f7b..842a379d2 100644 --- a/src/components/proxy/use-head-state.ts +++ b/src/components/proxy/use-head-state.ts @@ -55,11 +55,6 @@ export function useHeadStateNew() { const [state, dispatch] = useReducer(headStateReducer, {}); useEffect(() => { - if (!current) { - dispatch({ type: "reset" }); - return; - } - try { const data = JSON.parse( localStorage.getItem(HEAD_STATE_KEY)!, @@ -78,8 +73,6 @@ export function useHeadStateNew() { }, [current]); useEffect(() => { - if (!current) return; - const timer = setTimeout(() => { try { const item = localStorage.getItem(HEAD_STATE_KEY); @@ -99,10 +92,9 @@ export function useHeadStateNew() { const setHeadState = useCallback( (groupName: string, obj: Partial) => { - if (!current) return; dispatch({ type: "update", groupName, patch: obj }); }, - [current], + [], ); return [state, setHeadState] as const;