tf-checkout-react 1.4.5 → 1.4.6
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/tf-checkout-react.cjs.development.js +6 -2
- package/dist/tf-checkout-react.cjs.development.js.map +1 -1
- package/dist/tf-checkout-react.cjs.production.min.js +1 -1
- package/dist/tf-checkout-react.cjs.production.min.js.map +1 -1
- package/dist/tf-checkout-react.esm.js +6 -2
- package/dist/tf-checkout-react.esm.js.map +1 -1
- package/package.json +1 -1
- package/src/components/seatMapContainer/index.tsx +6 -2
package/package.json
CHANGED
|
@@ -78,6 +78,7 @@ export const SeatMapContainer = (props: IMapContainerProps) => {
|
|
|
78
78
|
const [guestCounts, setGuestCounts] = useState<IGuestCounts>(
|
|
79
79
|
{} as IGuestCounts
|
|
80
80
|
)
|
|
81
|
+
const isGuestCountsSet = useRef(false)
|
|
81
82
|
|
|
82
83
|
const updateGuestCounts = (data: any) => {
|
|
83
84
|
_forEach(data, (item: any) => {
|
|
@@ -85,10 +86,10 @@ export const SeatMapContainer = (props: IMapContainerProps) => {
|
|
|
85
86
|
const seatTicketsArray = _values(tierTickets)
|
|
86
87
|
|
|
87
88
|
setGuestCounts((prevState: any) => ({
|
|
88
|
-
...prevState,
|
|
89
89
|
[item.seatId]: Number(
|
|
90
90
|
seatTicketsArray[0].ticket_type_min_number_of_guests
|
|
91
91
|
),
|
|
92
|
+
...prevState,
|
|
92
93
|
}))
|
|
93
94
|
})
|
|
94
95
|
}
|
|
@@ -151,7 +152,10 @@ export const SeatMapContainer = (props: IMapContainerProps) => {
|
|
|
151
152
|
setReservedSeats(reservationData)
|
|
152
153
|
// automatically set ticket/table type if it's the only one
|
|
153
154
|
if (ticketTypeTierRelationsRef.current) {
|
|
154
|
-
|
|
155
|
+
if (!isGuestCountsSet.current) {
|
|
156
|
+
updateGuestCounts(reservationData)
|
|
157
|
+
isGuestCountsSet.current = true
|
|
158
|
+
}
|
|
155
159
|
_forEach(reservationData, (item: any) => {
|
|
156
160
|
const tierTickets = ticketTypeTierRelationsRef.current[item.tierId]
|
|
157
161
|
const seatTicketsArray = _values(tierTickets)
|