mirror of
https://github.com/Vendicated/Vencord.git
synced 2025-01-10 01:46:23 +00:00
Merge branch 'dev' into immediate-finds
This commit is contained in:
commit
8b2e8d19ba
2 changed files with 4 additions and 3 deletions
|
@ -66,7 +66,6 @@ export function addPatch(newPatch: Omit<Patch, "plugin">, pluginName: string) {
|
|||
patch.replacement = [patch.replacement];
|
||||
}
|
||||
|
||||
patch.replacement = patch.replacement.filter(({ predicate }) => !predicate || predicate());
|
||||
for (const replacement of patch.replacement) {
|
||||
canonicalizeReplacement(replacement, pluginName);
|
||||
|
||||
|
@ -75,6 +74,8 @@ export function addPatch(newPatch: Omit<Patch, "plugin">, pluginName: string) {
|
|||
}
|
||||
}
|
||||
|
||||
patch.replacement = patch.replacement.filter(({ predicate }) => !predicate || predicate());
|
||||
|
||||
patches.push(patch);
|
||||
}
|
||||
|
||||
|
|
|
@ -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 (
|
||||
<Flex flexDirection="row" style={{ gap: 0, flexWrap: "wrap", lineHeight: "0.9rem" }}>
|
||||
<Flex flexDirection="column" style={{ gap: 0, flexWrap: "wrap", lineHeight: "0.9rem" }}>
|
||||
<span>{text}</span>
|
||||
{!isNaN(since.getTime()) && <span>Received — {since.toDateString()}</span>}
|
||||
</Flex>
|
||||
|
|
Loading…
Reference in a new issue