decord/source/modules/game_profile/hooks/useSteamWebsiteUrl.tsx
github-actions 67d978d9fb chore: update source for alpha 346.0
Skipped 1 file(s) >100MB (GitHub limit): source/__vendor/09xxx/9672_m.js (378.6 MB)
2026-09-07 16:44:02 +00:00

76 lines
2.5 KiB
TypeScript

// Module ID: 8695
// Function ID: 8696
// Name: buildSteamStoreUrl
// Dependencies: [1916, 1074, 504, 8696, 8694, 1925, 2]
// Exports: buildSteamStoreUrl, useSteamWebsiteUrl
// Module 8695 (buildSteamStoreUrl)
import closure_2 from "createGamesFromMessage" /* 1916 */;
import { Distributors } from "ME" /* 1074 */;
const require = arg1;
const result = require("set").fileFinishedImporting("modules/game_profile/hooks/useSteamWebsiteUrl.tsx");
export const buildSteamStoreUrl = function buildSteamStoreUrl(arg0) {
return "https://store.steampowered.com/app/" + encodeURIComponent(arg0);
};
export const useSteamWebsiteUrl = function useSteamWebsiteUrl(id) {
const _require = id;
const items = [closure_2];
const items1 = [id];
return _require(504).useStateFromStores(items, () => {
if (null == id) {
return null;
} else {
const game = closure_1_2.getGame(tmp);
if (null == game) {
return null;
} else {
if (game.steamReleaseStatus === id(closure_1_1[3]).SteamReleaseStatus.RETIRED_ABANDONED) {
return null;
} else {
const websites = game.websites;
const found = websites.find((category) => category.category === callback(8694).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 = !callback(1925).isNullOrEmpty(distributor.id);
const obj = callback(1925);
}
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;
}
combined = tmp8;
}
let tmp7 = combined;
} else {
tmp7 = url;
}
return tmp7;
}
const tmp11 = id;
const tmp12 = closure_1_1;
}
}
}, items1);
};