decord/source/modules/premium/hooks/useGeoForUser.native.tsx

57 lines
2 KiB
TypeScript
Raw Normal View History

// Module ID: 7532
// Function ID: 7533
2026-07-20 16:05:17 +00:00
// Name: useGeoForUser
// Dependencies: [19, 502, 4299, 7351, 504, 7529, 4964, 2]
2026-07-20 16:05:17 +00:00
// Exports: default
// Module 7532 (useGeoForUser)
import actions_BillingActionCreatorsAll from "actions/BillingActionCreators" /* 4964 */;
import noop from "module_19" /* 19 */;
import AuthenticationStore from "AuthenticationStore" /* 502 */;
import BillingInfoStore from "BillingInfoStore" /* 4299 */;
import IAPStore from "IAPStore" /* 7351 */;
2026-07-23 10:11:24 +00:00
const require = fn;
const size = fn(2);
const result = size.fileFinishedImporting("modules/premium/hooks/useGeoForUser.native.tsx");
2026-07-20 16:05:17 +00:00
export default function useGeoForUser() {
const items = [IAPStore];
const stateFromStores = stateFromStores2(504).useStateFromStores(items, () => {
product = product.getProduct(stateFromStores2(dependencyMap[5]).ProductIds.PREMIUM_TIER_2_MONTHLY);
2026-07-20 16:05:17 +00:00
let countryCode;
2026-07-29 08:29:29 +00:00
if (product != null) {
2026-07-20 16:05:17 +00:00
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());
2026-07-20 16:05:17 +00:00
const items3 = [stateFromStores1, stateFromStores2];
const effect = noop.useEffect(() => {
2026-07-20 16:05:17 +00:00
let tmp = stateFromStores2;
if (stateFromStores2) {
tmp = !BillingInfoStore.ipLocationLoaded;
2026-07-20 16:05:17 +00:00
}
if (tmp) {
ipLocation = actions_BillingActionCreatorsAll.fetchIpLocation();
2026-07-20 16:05:17 +00:00
}
}, items3);
const obj4 = { defaultBillingCountryCode: stateFromStores, ipCountryCode: null, ipSubdivisionCode: null };
2026-07-20 16:05:17 +00:00
let countryCode;
2026-07-29 08:29:29 +00:00
if (stateFromStores1 != null) {
2026-07-20 16:05:17 +00:00
countryCode = stateFromStores1.countryCode;
}
obj4.ipCountryCode = countryCode;
2026-07-20 16:05:17 +00:00
let subdivisionCode;
2026-07-29 08:29:29 +00:00
if (stateFromStores1 != null) {
2026-07-20 16:05:17 +00:00
subdivisionCode = stateFromStores1.subdivisionCode;
}
obj4.ipSubdivisionCode = subdivisionCode;
return obj4;
2026-07-20 16:05:17 +00:00
};