Skip to content

Commit

Permalink
Bug fix: set last item to null once bookings component unmounts.
Browse files Browse the repository at this point in the history
  • Loading branch information
nimanns committed Dec 16, 2024
1 parent f301ba4 commit e57e8fe
Showing 1 changed file with 7 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ export const Bookings: React.FC<BookingsProps> = ({
pageContext,
calendarEventId,
}) => {
const { bookingsLoading, reloadFutureBookings, fetchAllBookings, allBookings, loadMoreEnabled } =
const { bookingsLoading, setLastItem, fetchAllBookings, allBookings, loadMoreEnabled } =
useContext(DatabaseContext);
const allowedStatuses = useAllowedStatuses(pageContext);

Expand All @@ -45,9 +45,12 @@ export const Bookings: React.FC<BookingsProps> = ({

const isUserView = pageContext === PageContextLevel.USER;

// useEffect(() => {
// reloadFutureBookings();
// }, []);
useEffect(() => {
// reloadFutureBookings();
return ()=>{
setLastItem(null);
}
}, []);

const filteredRows = useBookingFilters({
pageContext,
Expand Down

0 comments on commit e57e8fe

Please sign in to comment.