This commit is contained in:
janisslsm committed 2026-11-01 12:12:55 +02:00
1 parent 1781d25a15
commit 732c0ad767
33051 files changed
+2591613 -3019689

No files matched your search

@@ -0,0 +1,27 @@
// Metro module 8698 (f8699).
import { createWithEqualityFn } from "../../_bundle/identity_700";
import { shallow } from "../../_bundle/Module3802";
import { useDefaultVariantIndex } from "./hooks/useDefaultVariantIndex";
import { getIsVariantProduct } from "./utils/CollectiblesProductUtils";
const withEqualityFn = createWithEqualityFn(() => ({
selectionStates: new Map()
}), shallow);
export function useSelectedVariantIndex(a0) {
let c16733_0 = a0;
let r10 = useDefaultVariantIndex(a0);
const r13 = withEqualityFn((a0) => c16733_0 != null ? getIsVariantProduct(c16733_0) ? a0.selectionStates.get(c16733_0.storeListingId)?.selectedVariantIndex : null : null);
if (r13 != null) {
r10 = Math.max(0, r13);
}
return r10;
}
export function setSelectedVariantIndex(c16734_0, selectedVariantIndex) {
withEqualityFn.setState((state) => {
const selectionStates = state.selectionStates;
return selectionStates.get(c16734_0.storeListingId)?.selectedVariantIndex !== selectedVariantIndex ? {
selectionStates: new Map(state.selectionStates).set(c16734_0.storeListingId, {
selectedVariantIndex
})
} : state;
});
}