Skip to content

Commit

Permalink
RC #291 - Adding "key" prop to FacetTimeline events; Updating events …
Browse files Browse the repository at this point in the history
…fetching to clear existing events
  • Loading branch information
dleadbetter committed Aug 13, 2024
1 parent 69daa84 commit 6da17a7
Showing 1 changed file with 12 additions and 4 deletions.
16 changes: 12 additions & 4 deletions packages/core-data/src/components/FacetTimeline.js
Original file line number Diff line number Diff line change
Expand Up @@ -202,11 +202,18 @@ const FacetTimeline = (props: Props) => {
clearTimer();

// Reset the timer to fetch the events
setTimer(() => (
setTimer(() => {
setEvents([]);

const params = {
min_year: value[0],
max_year: value[1]
};

EventsService
.fetchAll({ min_year: value[0], max_year: value[1] })
.then(onLoad)
));
.fetchAll(params)
.then(onLoad);
});
}, [onLoad, max, min, value]);

/**
Expand Down Expand Up @@ -266,6 +273,7 @@ const FacetTimeline = (props: Props) => {
>
{ _.map(events, (event) => (
<Popover.Root
key={event.uuid}
open
>
<Popover.Trigger
Expand Down

0 comments on commit 6da17a7

Please sign in to comment.