mirror of
https://github.com/clash-verge-rev/clash-verge-rev.git
synced 2026-11-07 18:42:11 +08:00
chore(deps): lock file maintenance npm dependencies (#6015)
* chore(deps): lock file maintenance npm dependencies * chore(deps): bump npm deps * chore: fix eslint ref-name --------- Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> Co-authored-by: Slinetrac <realakayuki@gmail.com>
This commit is contained in:
co-authored by
renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
Slinetrac
parent
256a3f697b
commit
2128e1f788
@@ -25,7 +25,7 @@ export default function useFilterSort(
|
||||
const lastInputRef = useRef<{ text: string; sort: ProxySortType } | null>(
|
||||
null,
|
||||
);
|
||||
const debounceTimer = useRef<number | null>(null);
|
||||
const debounceTimerRef = useRef<number | null>(null);
|
||||
|
||||
useEffect(() => {
|
||||
let last = 0;
|
||||
@@ -68,9 +68,9 @@ export default function useFilterSort(
|
||||
);
|
||||
|
||||
useEffect(() => {
|
||||
if (debounceTimer.current !== null) {
|
||||
window.clearTimeout(debounceTimer.current);
|
||||
debounceTimer.current = null;
|
||||
if (debounceTimerRef.current !== null) {
|
||||
window.clearTimeout(debounceTimerRef.current);
|
||||
debounceTimerRef.current = null;
|
||||
}
|
||||
|
||||
const prev = lastInputRef.current;
|
||||
@@ -80,15 +80,15 @@ export default function useFilterSort(
|
||||
lastInputRef.current = { text: filterText, sort: sortType };
|
||||
|
||||
const delay = stableInputs ? 0 : 150;
|
||||
debounceTimer.current = window.setTimeout(() => {
|
||||
debounceTimerRef.current = window.setTimeout(() => {
|
||||
setResult(compute);
|
||||
debounceTimer.current = null;
|
||||
debounceTimerRef.current = null;
|
||||
}, delay);
|
||||
|
||||
return () => {
|
||||
if (debounceTimer.current !== null) {
|
||||
window.clearTimeout(debounceTimer.current);
|
||||
debounceTimer.current = null;
|
||||
if (debounceTimerRef.current !== null) {
|
||||
window.clearTimeout(debounceTimerRef.current);
|
||||
debounceTimerRef.current = null;
|
||||
}
|
||||
};
|
||||
}, [compute, filterText, sortType]);
|
||||
|
||||
Reference in New Issue
Block a user