From 6d605050e18ede4eba875f5fe2f52d984647d678 Mon Sep 17 00:00:00 2001 From: Nuckyz <61953774+Nuckyz@users.noreply.github.com> Date: Thu, 26 Oct 2023 15:07:44 -0300 Subject: [PATCH] Fix BetterNoteBox --- src/plugins/betterNotes/index.tsx | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/src/plugins/betterNotes/index.tsx b/src/plugins/betterNotes/index.tsx index 7049a3693..da41b9732 100644 --- a/src/plugins/betterNotes/index.tsx +++ b/src/plugins/betterNotes/index.tsx @@ -32,10 +32,16 @@ export default definePlugin({ { find: "hideNote:", all: true, + // Some modules match the find but the replacement is returned untouched + noWarn: true, predicate: () => Vencord.Settings.plugins.BetterNotesBox.hide, replacement: { - match: /hideNote:.+?(?=[,}])/g, - replace: "hideNote:true", + match: /hideNote:.+?(?=([,}].*?\)))/g, + replace: (m, rest) => { + const destructuringMatch = rest.match(/}=.+/); + if (destructuringMatch == null) return "hideNote:!0"; + return m; + } } }, {