From 868b2ea9f0134200d469bb7e8d037d709d9581a8 Mon Sep 17 00:00:00 2001 From: Nuckyz <61953774+Nuckyz@users.noreply.github.com> Date: Fri, 6 Sep 2024 09:40:10 -0300 Subject: [PATCH] Fix SortFriendRequests received date --- src/plugins/index.ts | 4 ++-- src/plugins/sortFriendRequests/index.tsx | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/src/plugins/index.ts b/src/plugins/index.ts index e6caf734..ac6821a6 100644 --- a/src/plugins/index.ts +++ b/src/plugins/index.ts @@ -66,14 +66,14 @@ export function addPatch(newPatch: Omit, pluginName: string) { patch.replacement = [patch.replacement]; } - patch.replacement = patch.replacement.filter(({ predicate }) => !predicate || predicate()); - if (IS_REPORTER) { patch.replacement.forEach(r => { delete r.predicate; }); } + patch.replacement = patch.replacement.filter(({ predicate }) => !predicate || predicate()); + patches.push(patch); } diff --git a/src/plugins/sortFriendRequests/index.tsx b/src/plugins/sortFriendRequests/index.tsx index 7033591b..64eb13fe 100644 --- a/src/plugins/sortFriendRequests/index.tsx +++ b/src/plugins/sortFriendRequests/index.tsx @@ -48,7 +48,7 @@ export default definePlugin({ find: ".Messages.FRIEND_REQUEST_CANCEL", replacement: { predicate: () => settings.store.showDates, - match: /subText:(\i)(?=,className:\i\.userInfo}\))(?<=user:(\i).+?)/, + match: /subText:(\i)(?<=user:(\i).+?)/, replace: (_, subtext, user) => `subText:$self.makeSubtext(${subtext},${user})` } }], @@ -66,7 +66,7 @@ export default definePlugin({ makeSubtext(text: string, user: User) { const since = this.getSince(user); return ( - + {text} {!isNaN(since.getTime()) && Received — {since.toDateString()}}