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

77 lines
2.4 KiB
TypeScript
Raw Normal View History

// Module ID: 8760
// Function ID: 8761
// Name: useSteamWebsiteUrl
// Dependencies: [1916, 1074, 504, 8761, 8759, 1925, 2]
2026-07-29 08:29:29 +00:00
// Exports: buildSteamStoreUrl, useSteamWebsiteUrl
2026-07-20 16:05:17 +00:00
// Module 8760 (useSteamWebsiteUrl)
import SteamReleaseStatus from "SteamReleaseStatus" /* 8761 */;
import GameStore from "GameStore" /* 1916 */;
2026-07-23 10:11:24 +00:00
const require = globalThis.__r;
require = fn;
const Distributors = fn(1074).Distributors;
const size = fn(2);
const result = size.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) {
_require = id;
const items = [GameStore];
2026-07-20 16:05:17 +00:00
const items1 = [id];
return require("initialize").useStateFromStores(items, () => {
if (null == closure_0) {
2026-07-20 16:05:17 +00:00
return null;
} else {
const game = GameStore.getGame(tmp);
2026-07-20 16:05:17 +00:00
if (null == game) {
return null;
} else if (game.steamReleaseStatus === SteamReleaseStatus.SteamReleaseStatus.RETIRED_ABANDONED) {
return null;
2026-07-20 16:05:17 +00:00
} else {
const websites = game.websites;
const found = websites.find((category) => category.category === id(8759).ThirdPartyGameApplicationWebsiteCategory.STEAM);
if (found != null) {
const url = found.url;
}
const thirdPartySkus = game.thirdPartySkus;
const found1 = thirdPartySkus.filter((distributor) => {
let tmp = distributor.distributor === constants.STEAM;
if (tmp) {
tmp = !id(1925).isNullOrEmpty(distributor.id);
const obj = id(1925);
2026-07-29 08:29:29 +00:00
}
return tmp;
});
const first = found1[0];
id = undefined;
if (first != null) {
id = first.id;
}
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;
2026-07-29 08:29:29 +00:00
}
combined = tmp8;
2026-07-29 08:29:29 +00:00
}
let tmp7 = combined;
} else {
tmp7 = url;
2026-07-20 16:05:17 +00:00
}
return tmp7;
2026-07-20 16:05:17 +00:00
}
}
}, items1);
};