fix(proxy): increase debounce delay and refine head state logic (#7464)

This commit is contained in:
oomeow
2026-07-12 08:22:22 +00:00
committed by GitHub
parent 14bc636ee8
commit 0337340471
+2 -5
View File
@@ -77,7 +77,7 @@ export const ProxyGroupTools = memo(function ProxyGroupTools(props: Props) {
filterUseRegularExpression: state.useRegularExpression,
})
},
{ wait: 300 },
{ wait: 600 },
)
// 关闭过滤框或卸载时立即应用最后一次输入,避免丢失未生效的过滤条件。
@@ -201,9 +201,6 @@ export const ProxyGroupTools = memo(function ProxyGroupTools(props: Props) {
onClick={(e) => {
e.preventDefault()
e.stopPropagation()
if (!headState.open)
// eslint-disable-next-line @eslint-react/dom-no-flush-sync
flushSync(() => onHeadState({ open: true }))
onHeadState({
textState: textState === 'url' ? null : 'url',
})
@@ -247,7 +244,7 @@ export const ProxyGroupTools = memo(function ProxyGroupTools(props: Props) {
onClick={(e) => {
e.preventDefault()
e.stopPropagation()
if (!headState.open)
if (!headState.open && textState !== 'filter')
// eslint-disable-next-line @eslint-react/dom-no-flush-sync
flushSync(() => onHeadState({ open: true }))
onHeadState({ textState: textState === 'filter' ? null : 'filter' })