fix(logs): avoid path filter effect loop

This commit is contained in:
Supra4E8C
2026-02-22 12:38:22 +08:00
Unverified
parent 3397b34dcc
commit a47c990cf4
+2 -2
View File
@@ -993,13 +993,13 @@ export function LogsPage() {
}, [parsedSearchLines]);
useEffect(() => {
if (pathFilters.length === 0) return;
const validPathSet = new Set(pathOptions.map((item) => item.path));
setPathFilters((prev) => {
if (prev.length === 0) return prev;
const next = prev.filter((path) => validPathSet.has(path));
return next.length === prev.length ? prev : next;
});
}, [pathFilters, pathOptions]);
}, [pathOptions]);
const toggleMethodFilter = (method: HttpMethod) => {
setMethodFilters((prev) =>