Files
discord-decomp/sources/modules/game_profile/hooks/useSteamWebsiteUrl.tsx
T
2026-07-27 16:20:00 +03:00

68 lines
3.4 KiB
TypeScript

/* Metro module 9968; source: modules/game_profile/hooks/useSteamWebsiteUrl.tsx; dependencies: [5199, 661, 566, 9969, 9967, 1861, 2] */
function _fun78047(global, require, importDefault, importAll, module, exports, dependencyMap) { // fn#78047, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:10154:6, offset: 0x01e16cd1, size: 155 bytes, params: 8, frame: 19
let env0_0 = require;
const closure = function(a0) {
return 'https://store.steampowered.com/app/' + (0, global.encodeURIComponent)(a0);
};
const Object = global.Object;
Object.defineProperty(exports, '__esModule', {value: true});
const gameStore = importDefault(5199) /* metro dependency 5199: GameStore */;
const env0_3 = (require(661) /* metro dependency 661: Constants */).Distributors;
(require(2) /* metro dependency 2 */).fileFinishedImporting('modules/game_profile/hooks/useSteamWebsiteUrl.tsx');
exports.buildSteamStoreUrl = closure;
exports.useSteamWebsiteUrl = function(a0) {
var env0_0 = a0;
return require(dependencyMap[2]).useStateFromStores([GameStore], _fun78050, [a0]);
};
}
function useSteamWebsiteUrl(a0) { // fn#78049, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:10154:372, offset: 0x01e16d96, size: 75 bytes, params: 2, frame: 16
const env0_0 = a0;
return (require(566) /* metro dependency 566: flux */).useStateFromStores([GameStore], _fun78050, [a0]);
}
function _fun78050() { // fn#78050, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:10154:442, offset: 0x01e16de1, size: 272 bytes, params: 1, frame: 17
const value2 = null;
if (value2 == env0_0) {
return value2;
}
let value = GameStore.getGame(env0_0);
if (value2 == value) {
return value2;
}
const steamReleaseStatus = value.steamReleaseStatus;
const value4 = undefined;
const SteamReleaseStatus = (require(9969) /* metro dependency 9969: SteamReleaseStatus */).SteamReleaseStatus;
const RETIRED_ABANDONED = SteamReleaseStatus.RETIRED_ABANDONED;
if (steamReleaseStatus === RETIRED_ABANDONED) {
return value2;
}
const value5 = value.websites.find(function({category}) {
return category === require(dependencyMap[4]).ThirdPartyGameApplicationWebsiteCategory.STEAM;
});
const url = value2 == value5 ? value4 : value5.url;
value = value.thirdPartySkus.filter(_fun78052);
const property = value[0];
const id = value2 == property ? value4 : property.id;
const stringUtilsModule = require(1861) /* metro dependency 1861: StringUtils */;
const r2 = stringUtilsModule.isNullOrEmpty(id) ? value2 : buildSteamStoreUrl(id);
return value.length > 1 && value2 != url ? url : value2 == r2 ? value2 != url ? url : value2 : r2;
}
function _fun78052(a0) { // fn#78052, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:10154:749, offset: 0x01e16f24, size: 72 bytes, params: 2, frame: 13
var r0;
const distributor = a0.distributor;
let value = environment.__proto__.__proto__;
const STEAM = Distributors.STEAM;
const value2 = distributor === STEAM;
if (value2) {
value = require(1861) /* metro dependency 1861: StringUtils */;
value = !value.isNullOrEmpty(a0.id);
r0 = value;
} else {
r0 = value2;
}
return r0;
}