Fix crashing in "disableTouchContextMenu" patch

This commit is contained in:
redphx 2024-10-18 22:19:06 +07:00
parent 15ae88e9e6
commit 63aaca7d61
2 changed files with 2 additions and 2 deletions

View File

@ -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" ? [

View File

@ -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;
},
};