fix: app crash issue on setting a greater recurring count than the maximum (#9899)

This commit is contained in:
Pradumn Kumar
2023-07-05 03:21:41 +05:30
committed by GitHub
parent 9c84c3db0a
commit 878a7cbfc5
@@ -204,7 +204,13 @@ const AvailabilityPage = ({ profile, eventType, ...restProps }: Props) => {
isFullWidth={false}
className="me-2 inline w-16"
onChange={(event) => {
setRecurringEventCount(parseInt(event?.target.value));
const count =
eventType?.recurringEvent?.count &&
parseInt(event?.target.value) > eventType?.recurringEvent?.count
? eventType.recurringEvent.count
: parseInt(event?.target.value);
setRecurringEventCount(count);
}}
/>