Skip to content

Commit

Permalink
Fix BetterNoteBox
Browse files Browse the repository at this point in the history
  • Loading branch information
Nuckyz committed Oct 26, 2023
1 parent 07c4a09 commit 6d60505
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions src/plugins/betterNotes/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
}
},
{
Expand Down

0 comments on commit 6d60505

Please sign in to comment.