@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.cjs
CHANGED
|
@@ -3482,13 +3482,18 @@ function BookingDetails({
|
|
|
3482
3482
|
const closeDeleteModal = React23__namespace.useCallback(() => {
|
|
3483
3483
|
setDeleteModalState({ open: false, adventureId: null, traveller: null });
|
|
3484
3484
|
}, []);
|
|
3485
|
+
const submitInFlightRef = React23__namespace.useRef(false);
|
|
3485
3486
|
const handleAddSubmit = React23__namespace.useCallback(
|
|
3486
3487
|
async (adventureId, data) => {
|
|
3487
3488
|
if (!onSubmitAddTraveller) return;
|
|
3489
|
+
if (submitInFlightRef.current) return;
|
|
3490
|
+
submitInFlightRef.current = true;
|
|
3488
3491
|
try {
|
|
3489
3492
|
await onSubmitAddTraveller(adventureId, data);
|
|
3490
3493
|
closeAddModal();
|
|
3491
3494
|
} catch (e) {
|
|
3495
|
+
} finally {
|
|
3496
|
+
submitInFlightRef.current = false;
|
|
3492
3497
|
}
|
|
3493
3498
|
},
|
|
3494
3499
|
[onSubmitAddTraveller, closeAddModal]
|
|
@@ -3496,10 +3501,14 @@ function BookingDetails({
|
|
|
3496
3501
|
const handleEditSubmit = React23__namespace.useCallback(
|
|
3497
3502
|
async (adventureId, travellerId, data) => {
|
|
3498
3503
|
if (!onSubmitEditTraveller) return;
|
|
3504
|
+
if (submitInFlightRef.current) return;
|
|
3505
|
+
submitInFlightRef.current = true;
|
|
3499
3506
|
try {
|
|
3500
3507
|
await onSubmitEditTraveller(adventureId, travellerId, data);
|
|
3501
3508
|
closeEditModal();
|
|
3502
3509
|
} catch (e) {
|
|
3510
|
+
} finally {
|
|
3511
|
+
submitInFlightRef.current = false;
|
|
3503
3512
|
}
|
|
3504
3513
|
},
|
|
3505
3514
|
[onSubmitEditTraveller, closeEditModal]
|
|
@@ -3507,10 +3516,14 @@ function BookingDetails({
|
|
|
3507
3516
|
const handleDeleteConfirm = React23__namespace.useCallback(
|
|
3508
3517
|
async (adventureId, travellerId) => {
|
|
3509
3518
|
if (!onConfirmRemoveTraveller) return;
|
|
3519
|
+
if (submitInFlightRef.current) return;
|
|
3520
|
+
submitInFlightRef.current = true;
|
|
3510
3521
|
try {
|
|
3511
3522
|
await onConfirmRemoveTraveller(adventureId, travellerId);
|
|
3512
3523
|
closeDeleteModal();
|
|
3513
3524
|
} catch (e) {
|
|
3525
|
+
} finally {
|
|
3526
|
+
submitInFlightRef.current = false;
|
|
3514
3527
|
}
|
|
3515
3528
|
},
|
|
3516
3529
|
[onConfirmRemoveTraveller, closeDeleteModal]
|