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

56 lines
1.9 KiB
TypeScript
Raw Normal View History

2026-08-25 06:04:03 +00:00
// Module ID: 7025
// Function ID: 7026
2026-07-20 16:05:17 +00:00
// Name: useGeoForUser
2026-08-25 06:04:03 +00:00
// Dependencies: [19, 1218, 4045, 5965, 589, 7022, 4725, 2]
2026-07-20 16:05:17 +00:00
// Exports: default
2026-08-25 06:04:03 +00:00
// Module 7025 (useGeoForUser)
2026-08-24 06:08:38 +00:00
import closure_3 from "noop" /* 19 */;
import closure_4 from "fetchFingerprint" /* 1218 */;
2026-08-25 06:04:03 +00:00
import closure_5 from "handlePaymentSourceCreateEnd" /* 4045 */;
import closure_6 from "updateProduct" /* 5965 */;
2026-07-23 10:11:24 +00:00
const require = arg1;
2026-08-24 06:08:38 +00:00
const result = require("set").fileFinishedImporting("modules/premium/hooks/useGeoForUser.native.tsx");
2026-07-20 16:05:17 +00:00
export default function useGeoForUser() {
2026-07-29 08:29:29 +00:00
let obj = stateFromStores2(589);
2026-08-24 06:08:38 +00:00
const items = [closure_6];
2026-07-20 16:05:17 +00:00
const stateFromStores = obj.useStateFromStores(items, () => {
2026-07-29 08:29:29 +00:00
product = product.getProduct(stateFromStores2(table[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;
});
2026-08-24 06:08:38 +00:00
const items1 = [closure_5];
2026-07-29 08:29:29 +00:00
const stateFromStores1 = stateFromStores2(589).useStateFromStores(items1, () => ipLocation.ipLocation);
const obj2 = stateFromStores2(589);
2026-08-24 06:08:38 +00:00
const items2 = [closure_4];
2026-07-29 08:29:29 +00:00
stateFromStores2 = stateFromStores2(589).useStateFromStores(items2, () => authenticated.isAuthenticated());
2026-07-20 16:05:17 +00:00
const items3 = [stateFromStores1, stateFromStores2];
const effect = React.useEffect(() => {
let tmp = stateFromStores2;
if (stateFromStores2) {
2026-08-24 06:08:38 +00:00
tmp = !closure_1_5.ipLocationLoaded;
2026-07-20 16:05:17 +00:00
}
if (tmp) {
2026-08-24 06:08:38 +00:00
const ipLocation = closure_1_1(closure_1_2[6]).fetchIpLocation();
const obj = closure_1_1(closure_1_2[6]);
2026-07-20 16:05:17 +00:00
}
}, items3);
2026-07-29 08:29:29 +00:00
obj = { 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;
}
2026-07-29 08:29:29 +00:00
obj[1] = 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;
}
2026-07-29 08:29:29 +00:00
obj[2] = subdivisionCode;
2026-07-20 16:05:17 +00:00
return obj;
};