({
isLoggedIn,
user,
}: {
isLoggedIn: boolean;
user: LoggedUser;
})
| 187 | export const transactionRefetchIntervalMs = 2500; |
| 188 | |
| 189 | export const coresPricesQueryOptions = ({ |
| 190 | isLoggedIn, |
| 191 | user, |
| 192 | }: { |
| 193 | isLoggedIn: boolean; |
| 194 | user: LoggedUser; |
| 195 | }) => { |
| 196 | return { |
| 197 | queryKey: generateQueryKey( |
| 198 | RequestKey.PricePreview, |
| 199 | user, |
| 200 | PurchaseType.Cores, |
| 201 | ), |
| 202 | queryFn: async () => { |
| 203 | if (iOSSupportsCoresPurchase()) { |
| 204 | const metadata = await fetchPricingMetadata(PurchaseType.Cores); |
| 205 | |
| 206 | return getApplePricing(metadata); |
| 207 | } |
| 208 | |
| 209 | return fetchPricingPreview(PurchaseType.Cores); |
| 210 | }, |
| 211 | enabled: isLoggedIn, |
| 212 | staleTime: StaleTime.Default, |
| 213 | }; |
| 214 | }; |
| 215 | |
| 216 | type UserTransactionSummary = { |
| 217 | purchased: number; |
no test coverage detected