Skip to content

Commit a6ca862

Browse files
committed
Have stats button reset textfilter
Usually if the user clicks on the stats button, they want to filter by exactly what the button promises, without the results being further influenced by a textfilter.
1 parent b5caf0d commit a6ca862

1 file changed

Lines changed: 4 additions & 1 deletion

File tree

src/components/shared/Stats.tsx

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ import {
77
fetchStats,
88
Stats as StatsType,
99
editTextFilter,
10+
removeTextFilter,
1011
} from "../../slices/tableFilterSlice";
1112
import { loadEventsIntoTable } from "../../thunks/tableThunks";
1213
import { useAppDispatch, useAppSelector } from "../../store";
@@ -28,8 +29,10 @@ const Stats = () => {
2829
let filterValue;
2930
await stats.filters.forEach((f) => {
3031
if (f.name.toLowerCase() === "textfilter") {
31-
dispatch(editTextFilter(f.value))
32+
dispatch(editTextFilter(f.value));
3233
return;
34+
} else {
35+
dispatch(removeTextFilter());
3336
}
3437
let filter = filterMap.find(({ name }) => name === f.name);
3538
filterValue = f.value;

0 commit comments

Comments
 (0)