Files
discord-decomp/sources/modules/premium/hooks/useGeoForUser.native.tsx
T
2026-07-28 01:06:53 +03:00

63 lines
3.9 KiB
TypeScript

/* Metro module 7036; source: modules/premium/hooks/useGeoForUser.native.tsx; dependencies: [31, 1226, 3804, 5140, 566, 7033, 4223, 2] */
import AuthenticationStore from '../../../stores/AuthenticationStore.tsx'; /* Metro dependency 1226 */
import BillingInfoStore from '../../../stores/billing/BillingInfoStore.tsx'; /* Metro dependency 3804 */
import IAPStoreAndroid from '../../../stores/native/IAPStore.android.tsx'; /* Metro dependency 5140 */
import * as FileImportTrackerModule from '../../../by-id/module-00002-FileImportTracker.js'; /* Metro dependency 2 */
import * as ReactModule from '../../../by-id/module-00031-React.js'; /* Metro dependency 31 */
import * as ProductIdsIosModule from '../native/ProductIds.ios.tsx'; /* Metro dependency 7033 */
function _fun55745(global, require, importDefault, importAll, module, exports, dependencyMap) { // fn#55745, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:7214:6, offset: 0x013b0bf6, size: 167 bytes, params: 8, frame: 20
const env0_0 = require;
const Object = global.Object;
Object.defineProperty(exports, '__esModule', {value: true});
(FileImportTrackerModule).fileFinishedImporting('modules/premium/hooks/useGeoForUser.native.tsx');
exports.default = useGeoForUser;
function useGeoForUser() { // fn#55746, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:7214:226, offset: 0x013b0c9d, size: 218 bytes, params: 1, frame: 20
const value2 = undefined;
const value3 = (require(566) /* metro dependency 566: flux */).useStateFromStores([IAPStoreAndroid], _fun55747);
const ipLocation = (require(566) /* metro dependency 566: flux */).useStateFromStores([BillingInfoStore],
function() {
return BillingInfoStore.ipLocation;
});
ReactModule.useEffect(_fun55750, [ipLocation,
(require(566) /* metro dependency 566: flux */).useStateFromStores([AuthenticationStore], function() {
return AuthenticationStore.isAuthenticated();
})]);
return {defaultBillingCountryCode: value3, ipCountryCode: ipLocation == null ? value2 : ipLocation.countryCode,
ipSubdivisionCode: ipLocation == null ? value2 : ipLocation.subdivisionCode};
function _fun55747() { // fn#55747, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:7214:289, offset: 0x013b0d77, size: 69 bytes, params: 1, frame: 13
let value = environment.__proto__;
const iapStoreAndroidBinding = IAPStoreAndroid;
const getProduct = iapStoreAndroidBinding.getProduct;
value = undefined;
const ProductIds = (ProductIdsIosModule).ProductIds;
const PREMIUM_TIER_2_MONTHLY = ProductIds.PREMIUM_TIER_2_MONTHLY;
const value2 = Reflect.apply(getProduct, iapStoreAndroidBinding, [PREMIUM_TIER_2_MONTHLY]);
return value2 == null ? value : value2.countryCode;
}
function _fun55750() { // fn#55750, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:7214:530, offset: 0x013b0de0, size: 70 bytes, params: 1, frame: 11
var r0;
var value;
const binding = env0_0;
if (binding) {
value = environment.__proto__;
value = !BillingInfoStore.ipLocationLoaded;
r0 = value;
} else {
r0 = binding;
}
if (r0) {
value = environment.__proto__;
value = importAll(4223) /* metro dependency 4223: BillingActionCreators */;
value.fetchIpLocation();
}
}
}
}
global.__d(_fun55745, 7036, [31, 1226, 3804, 5140, 566, 7033, 4223,
2]) /* metro module 7036, dependencies: [31, 1226, 3804, 5140, 566, 7033, 4223, 2] */;