@ticketboothapp/booking 1.2.145 → 1.2.146

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ticketboothapp/booking",
3
- "version": "1.2.145",
3
+ "version": "1.2.146",
4
4
  "private": false,
5
5
  "sideEffects": [
6
6
  "**/*.css",
@@ -423,14 +423,15 @@ export function useAdminChangeQuotePreview({
423
423
  })
424
424
  : await quoteChangeBooking(quoteRequestBase);
425
425
  if (seq !== changeQuoteRequestSeq.current) return;
426
- setLatestChangeQuote(
427
- sliceAndMergeChangeQuoteForUi(quote, {
426
+ const mergedQuote = sliceAndMergeChangeQuoteForUi(quote, {
428
427
  total: changeFlowNewBookingTotal,
429
428
  subtotal: effectiveSubtotalForCheckout,
430
429
  tax: effectiveTax,
431
- }, currency).mergedQuote,
432
- );
430
+ }, currency).mergedQuote;
431
+ // Commit the completed identity before publishing its result. This keeps a
432
+ // render caused by setLatestChangeQuote from being interpreted as a new request.
433
433
  lastCompletedQuoteInputsKeyRef.current = changeQuoteInputsKey;
434
+ setLatestChangeQuote(mergedQuote);
434
435
  } catch (e) {
435
436
  if (seq !== changeQuoteRequestSeq.current) return;
436
437
  setLatestChangeQuote(null);
@@ -451,34 +452,12 @@ export function useAdminChangeQuotePreview({
451
452
  window.clearTimeout(timer);
452
453
  };
453
454
  }, [
455
+ // Fetching is controlled by the canonical user-input identity. Do not add quote-derived
456
+ // totals, receipt objects, or display lines here: a response must not trigger another quote.
454
457
  isCustomerSelfServeChange,
455
458
  hasChangeSelection,
456
- selectedAvailability,
457
- initialValues,
458
- lastName,
459
459
  missingRequiredReturnSelection,
460
- pickupLocationId,
461
- selectedReturnOption?.returnAvailabilityId,
462
- quantities,
463
- addOnSelections,
464
- changeFlowInitialTicketCount,
465
- changeFlowNewBookingTotal,
466
- changeFlowClientEstimateDue,
467
- effectiveSubtotalForCheckout,
468
- effectiveTax,
469
- currency,
470
- adminCustomLinesAsAdditionalAdjustments,
471
- adminFeAuthoritativeReceipt,
472
- useAdminFeAuthoritativeQuote,
473
460
  changeQuoteInputsKey,
474
- originalReceipt,
475
- product.productId,
476
- setChangeQuoteLoading,
477
- setChangeQuoteFetchError,
478
- setLatestChangeQuote,
479
- lastCompletedQuoteInputsKeyRef,
480
- inFlightQuoteInputsKeyRef,
481
- changeQuoteRequestSeq,
482
461
  ]);
483
462
 
484
463
  return {