Files
discord-decomp/modules/collectibles/hooks/useDefaultVariantIndex.tsx
T
2026-11-01 12:12:55 +02:00

9 lines
545 B
TypeScript

// Metro module 8661 (f8662).
import CollectiblesPurchaseStore from "../CollectiblesPurchaseStore";
import { useStateFromStores } from "../../../_bundle/Module589";
import { getIsVariantProduct } from "../utils/CollectiblesProductUtils";
export function useDefaultVariantIndex(a0) {
const stateFromStores = useStateFromStores([CollectiblesPurchaseStore], () => CollectiblesPurchaseStore.purchases);
return a0 != null ? getIsVariantProduct(a0) ? Math.max(0, a0.variants.findIndex((variant) => !stateFromStores.has(variant.skuId))) : 0 : 0;
}