@planetaexo/design-system 0.22.1 → 0.22.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.cjs +13 -0
- package/dist/index.cjs.map +1 -1
- package/dist/index.js +13 -0
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -3461,13 +3461,18 @@ function BookingDetails({
|
|
|
3461
3461
|
const closeDeleteModal = React23.useCallback(() => {
|
|
3462
3462
|
setDeleteModalState({ open: false, adventureId: null, traveller: null });
|
|
3463
3463
|
}, []);
|
|
3464
|
+
const submitInFlightRef = React23.useRef(false);
|
|
3464
3465
|
const handleAddSubmit = React23.useCallback(
|
|
3465
3466
|
async (adventureId, data) => {
|
|
3466
3467
|
if (!onSubmitAddTraveller) return;
|
|
3468
|
+
if (submitInFlightRef.current) return;
|
|
3469
|
+
submitInFlightRef.current = true;
|
|
3467
3470
|
try {
|
|
3468
3471
|
await onSubmitAddTraveller(adventureId, data);
|
|
3469
3472
|
closeAddModal();
|
|
3470
3473
|
} catch (e) {
|
|
3474
|
+
} finally {
|
|
3475
|
+
submitInFlightRef.current = false;
|
|
3471
3476
|
}
|
|
3472
3477
|
},
|
|
3473
3478
|
[onSubmitAddTraveller, closeAddModal]
|
|
@@ -3475,10 +3480,14 @@ function BookingDetails({
|
|
|
3475
3480
|
const handleEditSubmit = React23.useCallback(
|
|
3476
3481
|
async (adventureId, travellerId, data) => {
|
|
3477
3482
|
if (!onSubmitEditTraveller) return;
|
|
3483
|
+
if (submitInFlightRef.current) return;
|
|
3484
|
+
submitInFlightRef.current = true;
|
|
3478
3485
|
try {
|
|
3479
3486
|
await onSubmitEditTraveller(adventureId, travellerId, data);
|
|
3480
3487
|
closeEditModal();
|
|
3481
3488
|
} catch (e) {
|
|
3489
|
+
} finally {
|
|
3490
|
+
submitInFlightRef.current = false;
|
|
3482
3491
|
}
|
|
3483
3492
|
},
|
|
3484
3493
|
[onSubmitEditTraveller, closeEditModal]
|
|
@@ -3486,10 +3495,14 @@ function BookingDetails({
|
|
|
3486
3495
|
const handleDeleteConfirm = React23.useCallback(
|
|
3487
3496
|
async (adventureId, travellerId) => {
|
|
3488
3497
|
if (!onConfirmRemoveTraveller) return;
|
|
3498
|
+
if (submitInFlightRef.current) return;
|
|
3499
|
+
submitInFlightRef.current = true;
|
|
3489
3500
|
try {
|
|
3490
3501
|
await onConfirmRemoveTraveller(adventureId, travellerId);
|
|
3491
3502
|
closeDeleteModal();
|
|
3492
3503
|
} catch (e) {
|
|
3504
|
+
} finally {
|
|
3505
|
+
submitInFlightRef.current = false;
|
|
3493
3506
|
}
|
|
3494
3507
|
},
|
|
3495
3508
|
[onConfirmRemoveTraveller, closeDeleteModal]
|