Update dist

This commit is contained in:
redphx 2024-05-08 08:04:09 +07:00
parent c2efbd9c1d
commit 9ac988e894

View File

@ -6557,7 +6557,6 @@ function setupScreenshotButton() {
// src/modules/touch-controller.ts // src/modules/touch-controller.ts
var LOG_TAG2 = "TouchController"; var LOG_TAG2 = "TouchController";
var GALLERY_TOUCH_GAMES = "9c86f07a-f3e8-45ad-82a0-a1f759597059";
class TouchController { class TouchController {
static #EVENT_SHOW_DEFAULT_CONTROLLER = new MessageEvent("message", { static #EVENT_SHOW_DEFAULT_CONTROLLER = new MessageEvent("message", {
@ -7534,6 +7533,13 @@ class RemotePlay {
} }
} }
// src/utils/gamepass-gallery.ts
var GamePassCloudGallery;
(function(GamePassCloudGallery2) {
GamePassCloudGallery2["TOUCH"] = "9c86f07a-f3e8-45ad-82a0-a1f759597059";
GamePassCloudGallery2["ALL"] = "29a81209-df6f-41fd-a528-2ae6b91f719c";
})(GamePassCloudGallery || (GamePassCloudGallery = {}));
// src/utils/network.ts // src/utils/network.ts
var clearApplicationInsightsBuffers = function() { var clearApplicationInsightsBuffers = function() {
window.sessionStorage.removeItem("AI_buffer"); window.sessionStorage.removeItem("AI_buffer");
@ -7655,6 +7661,7 @@ function interceptHttpRequests() {
} }
return nativeXhrSend.apply(this, arguments); return nativeXhrSend.apply(this, arguments);
}; };
let gamepassAllGames = [];
window.BX_FETCH = window.fetch = async (request, init) => { window.BX_FETCH = window.fetch = async (request, init) => {
let url = typeof request === "string" ? request : request.url; let url = typeof request === "string" ? request : request.url;
for (let blocked of BLOCKED_URLS) { for (let blocked of BLOCKED_URLS) {
@ -7672,14 +7679,24 @@ function interceptHttpRequests() {
if (url.endsWith("/configuration")) { if (url.endsWith("/configuration")) {
BxEvent.dispatch(window, BxEvent.STREAM_STARTING); BxEvent.dispatch(window, BxEvent.STREAM_STARTING);
} }
if (url.includes("catalog.gamepass.com") && url.includes(GALLERY_TOUCH_GAMES)) { if (STATES.hasTouchSupport && url.includes("catalog.gamepass.com/sigls/")) {
const response = await NATIVE_FETCH(request, init); const response = await NATIVE_FETCH(request, init);
const obj = await response.clone().json(); const obj = await response.clone().json();
if (url.includes(GamePassCloudGallery.ALL)) {
debugger;
for (let i = 1;i < obj.length; i++) {
gamepassAllGames.push(obj[i].id);
}
} else if (url.includes(GamePassCloudGallery.TOUCH)) {
debugger;
try { try {
const customList = TouchController.getCustomList().map((item2) => ({ id: item2 })); let customList = TouchController.getCustomList();
obj.push(...customList); customList = customList.filter((id2) => gamepassAllGames.includes(id2));
const newCustomList = customList.map((item2) => ({ id: item2 }));
obj.push(...newCustomList);
} catch (e) { } catch (e) {
} }
}
response.json = () => Promise.resolve(obj); response.json = () => Promise.resolve(obj);
return response; return response;
} }
@ -10195,9 +10212,14 @@ function overridePreloadState() {
} }
if (STATES.hasTouchSupport) { if (STATES.hasTouchSupport) {
TouchController.updateCustomList(); TouchController.updateCustomList();
const customList = TouchController.getCustomList(); let customList = TouchController.getCustomList();
try { try {
state.xcloud.sigls[GALLERY_TOUCH_GAMES]?.data.products.push(...customList); const sigls = state.xcloud.sigls;
if (GamePassCloudGallery.TOUCH in sigls) {
const allGames = sigls[GamePassCloudGallery.ALL].data.products;
customList = customList.filter((id2) => allGames.includes(id2));
sigls[GamePassCloudGallery.TOUCH]?.data.products.push(...customList);
}
} catch (e) { } catch (e) {
BxLogger.error(LOG_TAG5, e); BxLogger.error(LOG_TAG5, e);
} }