({
isLoggedIn,
user,
}: {
isLoggedIn: boolean;
user?: LoggedUser;
})
| 209 | export const transactionRefetchIntervalMs = 2500; |
| 210 | |
| 211 | export const coresPricesQueryOptions = ({ |
| 212 | isLoggedIn, |
| 213 | user, |
| 214 | }: { |
| 215 | isLoggedIn: boolean; |
| 216 | user?: LoggedUser; |
| 217 | }) => { |
| 218 | return { |
| 219 | queryKey: generateQueryKey( |
| 220 | RequestKey.PricePreview, |
| 221 | user, |
| 222 | PurchaseType.Cores, |
| 223 | ), |
| 224 | queryFn: async () => { |
| 225 | if (iOSSupportsCoresPurchase()) { |
| 226 | const metadata = await fetchPricingMetadata(PurchaseType.Cores); |
| 227 | |
| 228 | return getApplePricing(metadata); |
| 229 | } |
| 230 | |
| 231 | return fetchPricingPreview(PurchaseType.Cores); |
| 232 | }, |
| 233 | enabled: isLoggedIn, |
| 234 | staleTime: StaleTime.Default, |
| 235 | }; |
| 236 | }; |
| 237 | |
| 238 | type UserTransactionSummary = { |
| 239 | purchased: number; |
no test coverage detected