tf-checkout-react-native 2.0.0-beta.19 → 2.0.0-beta.21

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": "tf-checkout-react-native",
3
- "version": "2.0.0-beta.19",
3
+ "version": "2.0.0-beta.21",
4
4
  "description": "TheTicketFairy ReactNative Checkout library",
5
5
  "homepage": "https://github.com/theticketfairy/tf-shared-libraries#readme",
6
6
  "author": "The Ticket Fairy",
@@ -23,6 +23,7 @@ import { Pressable, StyleSheet, Text, View } from 'react-native'
23
23
  import {
24
24
  ConfirmerBusyError,
25
25
  changeTicketQuantity,
26
+ ticketPriceContext,
26
27
  errorMessage,
27
28
  hooks,
28
29
  ticketQuantityRange,
@@ -232,8 +233,9 @@ export const Tickets: FC<TicketsProps> = ({
232
233
  const originals = useRef<Record<string, number>>({})
233
234
  useEffect(() => {
234
235
  for (const t of tickets)
235
- if (originals.current[t.id] == null) originals.current[t.id] = t.price
236
- }, [tickets])
236
+ if (originals.current[ticketPriceContext(catalog.scope, t)] == null)
237
+ originals.current[ticketPriceContext(catalog.scope, t)] = t.price
238
+ }, [tickets, catalog.scope])
237
239
 
238
240
  const selected = tickets.filter((t) => (qty[t.id] ?? 0) > 0)
239
241
  // The current selection's kind — drives the CTA label and the mutual-exclusion
@@ -329,7 +331,7 @@ export const Tickets: FC<TicketsProps> = ({
329
331
  const renderRow = (t: TicketType) => {
330
332
  const notStarted = !t.salesStarted
331
333
  const unavailable = t.soldOut || t.salesEnded || notStarted
332
- const original = originals.current[t.id]
334
+ const original = originals.current[ticketPriceContext(catalog.scope, t)]
333
335
  const discounted = original != null && original > t.price
334
336
  const isFree = Number(t.price) === 0
335
337
  const sym = t.priceSymbol || t.currency