Skip to content

Commit

Permalink
Update VehicleScheduler.tsx
Browse files Browse the repository at this point in the history
  • Loading branch information
aelassas committed Jan 23, 2025
1 parent a3b4873 commit a96b95e
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion backend/src/components/VehicleScheduler.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,7 @@ const VehicleScheduler = (
end: new Date(1970, 0, 2),
}
]

const payload: bookcarsTypes.GetBookingsPayload = {
suppliers,
statuses,
Expand Down Expand Up @@ -77,6 +78,7 @@ const VehicleScheduler = (
color: helper.getBookingStatusBackgroundColor(booking.status),
textColor: helper.getBookingStatusTextColor(booking.status),
}))

setInit(false)

if (events.length === 0) {
Expand All @@ -93,7 +95,7 @@ const VehicleScheduler = (
if (!init && statuses.length > 0 && suppliers.length > 0) {
fetchEvents()
}
}, [statuses, suppliers, filter, init, fetchBookings])
}, [statuses, suppliers, filter]) // eslint-disable-line react-hooks/exhaustive-deps

const getTranslations = (_language: string) => {
if (_language === 'fr') {
Expand Down Expand Up @@ -212,6 +214,7 @@ const VehicleScheduler = (
disableViewer
editable={false}
draggable={false}
agenda={false}
onEventClick={(event: ProcessedEvent) => {
const url = `/update-booking?b=${event.event_id}`
window.open(url, '_blank')!.focus()
Expand Down

0 comments on commit a96b95e

Please sign in to comment.