From 85f4afe2a15b2f152e3c5d4f8b6f85a708e36a1e Mon Sep 17 00:00:00 2001 From: oomeow Date: Sun, 12 Oct 2025 15:09:20 +0800 Subject: [PATCH] perf: reduce reset scroller position --- src/components/proxy/proxy-groups.tsx | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/src/components/proxy/proxy-groups.tsx b/src/components/proxy/proxy-groups.tsx index f3fd255c..e76e2489 100644 --- a/src/components/proxy/proxy-groups.tsx +++ b/src/components/proxy/proxy-groups.tsx @@ -121,7 +121,7 @@ export const ProxyGroups = (props: Props) => { } catch (e) { console.error("Error restoring scroll position:", e); } - }, [mode, renderList]); + }, [mode, renderList.length]); // 改为使用节流函数保存滚动位置 const saveScrollPosition = useCallback( @@ -213,7 +213,6 @@ export const ProxyGroups = (props: Props) => { const currentGroup = getCurrentGroup(); const availableGroups = getAvailableGroups(); - // TODO: 频繁点击切换代理节点,导致应用卡死 const handleChangeProxy = useCallback( (group: IProxyGroupItem, proxy: IProxyItem) => { if (isChainMode) {