Skip to content

Commit b5caf0d

Browse files
committed
Allow stats to set textfilter
The stats over the events table (Today, Running etc.) can set filters for the events table if clicked on. However, it was not possible to use this to set a textfilter (text in the search field). This patch fixes that.
1 parent 69fa37d commit b5caf0d

1 file changed

Lines changed: 5 additions & 0 deletions

File tree

src/components/shared/Stats.tsx

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ import {
66
resetFilterValues,
77
fetchStats,
88
Stats as StatsType,
9+
editTextFilter,
910
} from "../../slices/tableFilterSlice";
1011
import { loadEventsIntoTable } from "../../thunks/tableThunks";
1112
import { useAppDispatch, useAppSelector } from "../../store";
@@ -26,6 +27,10 @@ const Stats = () => {
2627
dispatch(resetFilterValues());
2728
let filterValue;
2829
await stats.filters.forEach((f) => {
30+
if (f.name.toLowerCase() === "textfilter") {
31+
dispatch(editTextFilter(f.value))
32+
return;
33+
}
2934
let filter = filterMap.find(({ name }) => name === f.name);
3035
filterValue = f.value;
3136
if (!!filter) {

0 commit comments

Comments
 (0)