From 5a0e5018297e83877a8db7b323d3c265b7663393 Mon Sep 17 00:00:00 2001 From: V Date: Thu, 22 Jun 2023 22:35:59 +0200 Subject: Fix ValidUser, BetterFolders & MutualGroupDms Co-authored-by: Juby210 <31005896+Juby210@users.noreply.github.com> Co-authored-by: Amia <9750071+aamiaa@users.noreply.github.com> --- src/plugins/betterFolders/FolderSideBar.tsx | 3 ++- src/plugins/mutualGroupDMs.tsx | 2 +- src/plugins/validUser.tsx | 6 +++--- 3 files changed, 6 insertions(+), 5 deletions(-) (limited to 'src') diff --git a/src/plugins/betterFolders/FolderSideBar.tsx b/src/plugins/betterFolders/FolderSideBar.tsx index 7159f7e..6353a97 100644 --- a/src/plugins/betterFolders/FolderSideBar.tsx +++ b/src/plugins/betterFolders/FolderSideBar.tsx @@ -36,7 +36,8 @@ function Guilds(props: { // @ts-expect-error const res = Vencord.Plugins.plugins.BetterFolders.Guilds(props); - const scrollerProps = res.props.children?.props?.children?.[1]?.props; + // TODO: Make this better + const scrollerProps = res.props.children?.props?.children?.props?.children?.[1]?.props; if (scrollerProps?.children) { const servers = scrollerProps.children.find(c => c?.props?.["aria-label"] === i18n.Messages.SERVERS); if (servers) scrollerProps.children = servers; diff --git a/src/plugins/mutualGroupDMs.tsx b/src/plugins/mutualGroupDMs.tsx index 6d6dc52..a365813 100644 --- a/src/plugins/mutualGroupDMs.tsx +++ b/src/plugins/mutualGroupDMs.tsx @@ -78,7 +78,7 @@ export default definePlugin({
{getGroupDMName(c)}
-
{c.recipients.length} Members
+
{c.recipients.length + 1} Members
)); diff --git a/src/plugins/validUser.tsx b/src/plugins/validUser.tsx index 42349b4..69e0f13 100644 --- a/src/plugins/validUser.tsx +++ b/src/plugins/validUser.tsx @@ -24,7 +24,7 @@ import definePlugin from "@utils/types"; import { findByCodeLazy } from "@webpack"; import { UserStore, useState } from "@webpack/common"; import type { User } from "discord-types/general"; -import type { ComponentType } from "react"; +import type { ComponentType, ReactNode } from "react"; const fetching = new Set(); const queue = new Queue(5); @@ -36,7 +36,7 @@ interface MentionProps { channelId?: string; content: any; }; - parse: (content: any, props: MentionProps["props"]) => string[]; + parse: (content: any, props: MentionProps["props"]) => ReactNode; props: { key: string; formatInline: boolean; @@ -72,7 +72,7 @@ function MentionWrapper({ data, UserMention, RoleMention, parse, props }: Mentio > { - const mention = children?.[0]; + const mention = children?.[0]?.props?.children; if (typeof mention !== "string") return; const id = mention.match(/<@(\d+)>/)?.[1]; -- cgit