mirror of
https://github.com/clash-verge-rev/clash-verge-rev.git
synced 2026-11-23 21:12:28 +08:00
perf(proxies): reduce remaining projection and menu churn (#8622)
This commit is contained in:
@@ -571,6 +571,17 @@ function NormalProxyGroups(props: { mode: string }) {
|
||||
[renderList],
|
||||
)
|
||||
|
||||
const onStickyHeadState = useCallback(
|
||||
async (groupName: string, patch: Partial<HeadState>) => {
|
||||
if (patch.filterText !== undefined) {
|
||||
handleGroupLocationByName(groupName)
|
||||
await stickyListRef.current?.waitForScrollEnd()
|
||||
}
|
||||
onHeadState(groupName, patch)
|
||||
},
|
||||
[handleGroupLocationByName, onHeadState],
|
||||
)
|
||||
|
||||
const renderGroupItem = useCallback(
|
||||
(item: IRenderItem, _index: number, stickyed: boolean) => (
|
||||
<ProxyRender
|
||||
@@ -578,13 +589,7 @@ function NormalProxyGroups(props: { mode: string }) {
|
||||
stickyed={stickyed}
|
||||
onLocation={handleLocation}
|
||||
onCheckAll={handleCheckAll}
|
||||
onHeadState={async (groupName, patch) => {
|
||||
if (stickyed && patch.filterText !== undefined) {
|
||||
handleGroupLocationByName(groupName)
|
||||
await stickyListRef.current?.waitForScrollEnd()
|
||||
}
|
||||
onHeadState(groupName, patch)
|
||||
}}
|
||||
onHeadState={stickyed ? onStickyHeadState : onHeadState}
|
||||
onChangeProxy={handleChangeProxy}
|
||||
onGroupToggle={handleGroupToggle}
|
||||
/>
|
||||
@@ -595,7 +600,7 @@ function NormalProxyGroups(props: { mode: string }) {
|
||||
onHeadState,
|
||||
handleLocation,
|
||||
handleGroupToggle,
|
||||
handleGroupLocationByName,
|
||||
onStickyHeadState,
|
||||
],
|
||||
)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user