decord/source/modules/premium/hooks/useGeoForUser.native.tsx
github-actions ecf26fc058 chore: update source for alpha 347.2
Skipped 1 file(s) >100MB (GitHub limit): source/__polyfill/04xxx/module_4823.js (118.4 MB)
2026-09-16 07:03:15 +00:00

56 lines
2 KiB
TypeScript

// Module ID: 7528
// Function ID: 7529
// Name: useGeoForUser
// Dependencies: [19, 502, 4297, 7347, 504, 7525, 4962, 2]
// Exports: default
// Module 7528 (useGeoForUser)
import actions_BillingActionCreatorsAll from "actions/BillingActionCreators" /* 4962 */;
import noop from "module_19" /* 19 */;
import AuthenticationStore from "AuthenticationStore" /* 502 */;
import BillingInfoStore from "BillingInfoStore" /* 4297 */;
import IAPStore from "IAPStore" /* 7347 */;
const require = fn;
const size = fn(2);
const result = size.fileFinishedImporting("modules/premium/hooks/useGeoForUser.native.tsx");
export default function useGeoForUser() {
const items = [IAPStore];
const stateFromStores = stateFromStores2(504).useStateFromStores(items, () => {
product = product.getProduct(stateFromStores2(dependencyMap[5]).ProductIds.PREMIUM_TIER_2_MONTHLY);
let countryCode;
if (product != null) {
countryCode = product.countryCode;
}
return countryCode;
});
let obj = stateFromStores2(504);
const items1 = [BillingInfoStore];
const stateFromStores1 = stateFromStores2(504).useStateFromStores(items1, () => ipLocation.ipLocation);
const obj2 = stateFromStores2(504);
const items2 = [AuthenticationStore];
stateFromStores2 = stateFromStores2(504).useStateFromStores(items2, () => authenticated.isAuthenticated());
const items3 = [stateFromStores1, stateFromStores2];
const effect = noop.useEffect(() => {
let tmp = stateFromStores2;
if (stateFromStores2) {
tmp = !BillingInfoStore.ipLocationLoaded;
}
if (tmp) {
ipLocation = actions_BillingActionCreatorsAll.fetchIpLocation();
}
}, items3);
const obj4 = { defaultBillingCountryCode: stateFromStores, ipCountryCode: null, ipSubdivisionCode: null };
let countryCode;
if (stateFromStores1 != null) {
countryCode = stateFromStores1.countryCode;
}
obj4.ipCountryCode = countryCode;
let subdivisionCode;
if (stateFromStores1 != null) {
subdivisionCode = stateFromStores1.subdivisionCode;
}
obj4.ipSubdivisionCode = subdivisionCode;
return obj4;
};