Merge pull request #21 from BlackRoad-OS/codex/fix-high-priority-bug-in-event-filters

Avoid stale refetch when applying event filters
This commit is contained in:
Alexa Amundson
2025-11-23 15:14:39 -06:00
committed by GitHub

View File

@@ -9,11 +9,10 @@ export default function EventsPage() {
const [limit, setLimit] = useState<number | undefined>(25); const [limit, setLimit] = useState<number | undefined>(25);
const [type, setType] = useState(''); const [type, setType] = useState('');
const [source, setSource] = useState(''); const [source, setSource] = useState('');
const { events, isLoading, error, setParams, refetch } = useEvents({ limit }); const { events, isLoading, error, setParams } = useEvents({ limit });
const applyFilters = () => { const applyFilters = () => {
setParams({ limit, type: type || undefined, source: source || undefined }); setParams({ limit, type: type || undefined, source: source || undefined });
refetch();
}; };
const columns = [ const columns = [