From 4d0756369aead5bba8d2f6b81fb73b3a04d8d2c2 Mon Sep 17 00:00:00 2001 From: Harry Huang Date: Mon, 26 Feb 2024 16:28:20 -0600 Subject: [PATCH] Fix filter by tag bugf --- components/table/event-table/EventTableImpl.tsx | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/components/table/event-table/EventTableImpl.tsx b/components/table/event-table/EventTableImpl.tsx index c784304..e11494b 100644 --- a/components/table/event-table/EventTableImpl.tsx +++ b/components/table/event-table/EventTableImpl.tsx @@ -55,15 +55,20 @@ const EventTableImpl = ({ setDataForTable(convertEventDataToRowData(data)); setFilteredDataByTags(dataForTable); }, - revalidateOnFocus: true, - revalidateOnReconnect: true, + revalidateOnFocus: false, + revalidateOnReconnect: false, } ); - // Extra defense to refetch data if needed + // Refetch data when data is updated useEffect(() => { mutate(); - }, [mutate, data, filteredDataByTags]); + }, [mutate, data]); + + //Reset filtered data if data is updated + useEffect(() => { + setFilteredDataByTags(dataForTable); + }, [dataForTable, setFilteredDataByTags]); // check for errors and loading if (error) return
Failed to load event table
;