Fix BetterNoteBox
This commit is contained in:
parent
07c4a097e0
commit
6d605050e1
1 changed files with 8 additions and 2 deletions
|
@ -32,10 +32,16 @@ export default definePlugin({
|
||||||
{
|
{
|
||||||
find: "hideNote:",
|
find: "hideNote:",
|
||||||
all: true,
|
all: true,
|
||||||
|
// Some modules match the find but the replacement is returned untouched
|
||||||
|
noWarn: true,
|
||||||
predicate: () => Vencord.Settings.plugins.BetterNotesBox.hide,
|
predicate: () => Vencord.Settings.plugins.BetterNotesBox.hide,
|
||||||
replacement: {
|
replacement: {
|
||||||
match: /hideNote:.+?(?=[,}])/g,
|
match: /hideNote:.+?(?=([,}].*?\)))/g,
|
||||||
replace: "hideNote:true",
|
replace: (m, rest) => {
|
||||||
|
const destructuringMatch = rest.match(/}=.+/);
|
||||||
|
if (destructuringMatch == null) return "hideNote:!0";
|
||||||
|
return m;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
|
|
Loading…
Reference in a new issue