Skip to content

Commit

Permalink
fix d1
Browse files Browse the repository at this point in the history
  • Loading branch information
stephmilovic committed Aug 7, 2023
1 parent 8729f96 commit 4254ddf
Showing 1 changed file with 8 additions and 15 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -261,8 +261,6 @@ export const useTimelineEventsHandler = ({
totalCount: response.totalCount,
updatedAt: Date.now(),
};
setUpdated(newTimelineResponse.updatedAt);
setTotalCount(newTimelineResponse.totalCount);
if (onNextHandler) onNextHandler(newTimelineResponse);
return newTimelineResponse;
});
Expand Down Expand Up @@ -294,19 +292,7 @@ export const useTimelineEventsHandler = ({
asyncSearch();
refetch.current = asyncSearch;
},
[
skip,
data,
setTotalCount,
entityType,
dataViewId,
setUpdated,
addWarning,
startTracking,
dispatch,
id,
prevFilterStatus,
]
[skip, data, entityType, dataViewId, addWarning, startTracking, dispatch, id, prevFilterStatus]
);

useEffect(() => {
Expand Down Expand Up @@ -392,6 +378,13 @@ export const useTimelineEventsHandler = ({
filterStatus,
]);

useEffect(() => {
if (timelineResponse.totalCount > -1) {
setUpdated(timelineResponse.updatedAt);
setTotalCount(timelineResponse.totalCount);
}
}, [setTotalCount, setUpdated, timelineResponse]);

const timelineEventsSearchHandler = useCallback(
(onNextHandler?: OnNextResponseHandler) => {
if (!deepEqual(prevTimelineRequest.current, timelineRequest)) {
Expand Down

0 comments on commit 4254ddf

Please sign in to comment.