From 63aaca7d6177d9553a38823dae89df6437612241 Mon Sep 17 00:00:00 2001 From: redphx <96280+redphx@users.noreply.github.com> Date: Fri, 18 Oct 2024 22:19:06 +0700 Subject: [PATCH] Fix crashing in "disableTouchContextMenu" patch --- dist/better-xcloud.user.js | 2 +- src/modules/patcher.ts | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/dist/better-xcloud.user.js b/dist/better-xcloud.user.js index 7ab6344..57ee10a 100644 --- a/dist/better-xcloud.user.js +++ b/dist/better-xcloud.user.js @@ -4333,7 +4333,7 @@ if (this.baseStorageKey in window.BX_EXPOSED.overrideSettings) { disableTouchContextMenu(str) { let index = str.indexOf('"ContextualCardActions-module__container'); if (index >= 0 && (index = str.indexOf('addEventListener("touchstart"', index)), index >= 0 && (index = PatcherUtils.lastIndexOf(str, "return ", index, 50)), index < 0) return !1; - return str = PatcherUtils.replaceWith(str, index, "return", "return null;"), str; + return str = PatcherUtils.replaceWith(str, index, "return", "return () => {};"), str; } }, PATCH_ORDERS = [ ...getPref("native_mkb_enabled") === "on" ? [ diff --git a/src/modules/patcher.ts b/src/modules/patcher.ts index c8d5911..0917417 100644 --- a/src/modules/patcher.ts +++ b/src/modules/patcher.ts @@ -962,7 +962,7 @@ if (this.baseStorageKey in window.BX_EXPOSED.overrideSettings) { return false; } - str = PatcherUtils.replaceWith(str, index, 'return', 'return null;'); + str = PatcherUtils.replaceWith(str, index, 'return', 'return () => {};'); return str; }, };