From 79c5cf530403e214ea2cf4f3c3c500d98ad0424c Mon Sep 17 00:00:00 2001 From: sadan4 <117494111+sadan4@users.noreply.github.com> Date: Sat, 27 Sep 2025 15:59:18 -0400 Subject: [PATCH] fix plugins for latest Discord update (#3681) Co-authored-by: Nuckyz <61953774+Nuckyz@users.noreply.github.com> --- src/plugins/_core/settings.tsx | 5 +++-- src/plugins/implicitRelationships/index.ts | 2 +- src/webpack/common/components.ts | 8 +------- 3 files changed, 5 insertions(+), 10 deletions(-) diff --git a/src/plugins/_core/settings.tsx b/src/plugins/_core/settings.tsx index 4d12f37a..a632e9fa 100644 --- a/src/plugins/_core/settings.tsx +++ b/src/plugins/_core/settings.tsx @@ -67,8 +67,9 @@ export default definePlugin({ { find: "#{intl::USER_SETTINGS_ACTIONS_MENU_LABEL}", replacement: { - match: /(?<=function\((\i),\i\)\{)(?=let \i=Object.values\(\i.\i\).*?(\i\.\i)\.open\()/, - replace: "$2.open($1);return;" + // Skip the check Discord performs to make sure the section being selected in the user settings context menu is valid + match: /(?<=function\((\i),(\i),\i\)\{)(?=let \i=Object.values\(\i\.\i\).+?(\(0,\i\.openUserSettings\))\()/, + replace: (_, settingsPanel, section, openUserSettings) => `${openUserSettings}(${settingsPanel},{section:${section}});return;` } } ], diff --git a/src/plugins/implicitRelationships/index.ts b/src/plugins/implicitRelationships/index.ts index d57370a0..a49635e1 100644 --- a/src/plugins/implicitRelationships/index.ts +++ b/src/plugins/implicitRelationships/index.ts @@ -48,7 +48,7 @@ export default definePlugin({ }, // Sections header { - find: "#{intl::FRIENDS_SECTION_ONLINE}", + find: "#{intl::FRIENDS_SECTION_ONLINE}),className:", replacement: { match: /,{id:(\i\.\i)\.PENDING,show:.+?className:(\i\.item)/, replace: (rest, relationShipTypes, className) => `,{id:${relationShipTypes}.IMPLICIT,show:true,className:${className},content:"Implicit"}${rest}` diff --git a/src/webpack/common/components.ts b/src/webpack/common/components.ts index 9715619a..b975f303 100644 --- a/src/webpack/common/components.ts +++ b/src/webpack/common/components.ts @@ -87,13 +87,7 @@ export const ListScrollerNone = LazyComponent(() => createListScroller(listScrol export const ListScrollerThin = LazyComponent(() => createListScroller(listScrollerClasses.thin, listScrollerClasses.fade, "", ResizeObserver)); export const ListScrollerAuto = LazyComponent(() => createListScroller(listScrollerClasses.auto, listScrollerClasses.fade, "", ResizeObserver)); -const { FocusLock_ } = mapMangledModuleLazy('document.getElementById("app-mount"))', { - FocusLock_: filters.componentByCode(".containerRef") -}) as { - FocusLock_: t.FocusLock; -}; - -export const FocusLock = LazyComponent(() => FocusLock_); +export const FocusLock = waitForComponent("FocusLock", filters.componentByCode(".containerRef,{keyboardModeEnabled:")); export let useToken: t.useToken; waitFor(m => {