decord/source/modules/game_profile/hooks/useSteamWebsiteUrl.tsx

77 lines
2.5 KiB
TypeScript
Raw Normal View History

2026-08-24 06:08:38 +00:00
// Module ID: 9142
// Function ID: 9143
2026-07-20 16:05:17 +00:00
// Name: buildSteamStoreUrl
2026-08-24 06:08:38 +00:00
// Dependencies: [4509, 676, 589, 9143, 9141, 1903, 2]
2026-07-29 08:29:29 +00:00
// Exports: buildSteamStoreUrl, useSteamWebsiteUrl
2026-07-20 16:05:17 +00:00
2026-08-24 06:08:38 +00:00
// Module 9142 (buildSteamStoreUrl)
import closure_2 from "handleLoadMessages" /* 4509 */;
import { Distributors } from "ME" /* 676 */;
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/game_profile/hooks/useSteamWebsiteUrl.tsx");
2026-07-20 16:05:17 +00:00
2026-07-29 08:29:29 +00:00
export const buildSteamStoreUrl = function buildSteamStoreUrl(arg0) {
return "https://store.steampowered.com/app/" + encodeURIComponent(arg0);
};
2026-07-20 16:05:17 +00:00
export const useSteamWebsiteUrl = function useSteamWebsiteUrl(id) {
2026-07-23 10:11:24 +00:00
const _require = id;
2026-08-24 06:08:38 +00:00
const items = [closure_2];
2026-07-20 16:05:17 +00:00
const items1 = [id];
2026-07-29 08:29:29 +00:00
return _require(589).useStateFromStores(items, () => {
2026-07-23 10:11:24 +00:00
if (null == id) {
2026-07-20 16:05:17 +00:00
return null;
} else {
2026-08-24 06:08:38 +00:00
const game = closure_1_2.getGame(tmp);
2026-07-20 16:05:17 +00:00
if (null == game) {
return null;
} else {
2026-08-24 06:08:38 +00:00
if (game.steamReleaseStatus === id(closure_1_1[3]).SteamReleaseStatus.RETIRED_ABANDONED) {
2026-07-29 08:29:29 +00:00
return null;
} else {
const websites = game.websites;
2026-08-24 06:08:38 +00:00
const found = websites.find((category) => category.category === callback(9141).ThirdPartyGameApplicationWebsiteCategory.STEAM);
2026-07-29 08:29:29 +00:00
if (found != null) {
const url = found.url;
2026-07-20 16:05:17 +00:00
}
2026-07-29 08:29:29 +00:00
const thirdPartySkus = game.thirdPartySkus;
const found1 = thirdPartySkus.filter((distributor) => {
let tmp = distributor.distributor === constants.STEAM;
if (tmp) {
2026-08-11 06:20:06 +00:00
tmp = !callback(1903).isNullOrEmpty(distributor.id);
const obj = callback(1903);
2026-07-20 16:05:17 +00:00
}
2026-07-29 08:29:29 +00:00
return tmp;
});
const first = found1[0];
id = undefined;
if (first != null) {
id = first.id;
2026-07-20 16:05:17 +00:00
}
2026-07-29 08:29:29 +00:00
let combined = null;
if (!tmp11Result.isNullOrEmpty(id)) {
const _encodeURIComponent = encodeURIComponent;
const _HermesInternal = HermesInternal;
combined = "https://store.steampowered.com/app/" + encodeURIComponent(id);
}
if (found1.length <= 1) {
if (null == combined) {
let tmp8 = null;
if (null != url) {
tmp8 = url;
}
combined = tmp8;
}
let tmp7 = combined;
} else {
tmp7 = url;
}
return tmp7;
2026-07-20 16:05:17 +00:00
}
2026-07-29 08:29:29 +00:00
const tmp11 = id;
2026-08-24 06:08:38 +00:00
const tmp12 = closure_1_1;
2026-07-20 16:05:17 +00:00
}
}
}, items1);
};