Fix ValidUser, BetterFolders & MutualGroupDms

Co-authored-by: Juby210 <31005896+Juby210@users.noreply.github.com>
Co-authored-by: Amia <9750071+aamiaa@users.noreply.github.com>
This commit is contained in:
V 2023-06-22 22:35:59 +02:00
parent 92113da7c0
commit 5a0e501829
No known key found for this signature in database
GPG key ID: A1DC0CFB5615D905
3 changed files with 6 additions and 5 deletions

View file

@ -36,7 +36,8 @@ function Guilds(props: {
// @ts-expect-error // @ts-expect-error
const res = Vencord.Plugins.plugins.BetterFolders.Guilds(props); 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) { if (scrollerProps?.children) {
const servers = scrollerProps.children.find(c => c?.props?.["aria-label"] === i18n.Messages.SERVERS); const servers = scrollerProps.children.find(c => c?.props?.["aria-label"] === i18n.Messages.SERVERS);
if (servers) scrollerProps.children = servers; if (servers) scrollerProps.children = servers;

View file

@ -78,7 +78,7 @@ export default definePlugin({
</Avatar> </Avatar>
<div className={ProfileListClasses.listRowContent}> <div className={ProfileListClasses.listRowContent}>
<div className={ProfileListClasses.listName}>{getGroupDMName(c)}</div> <div className={ProfileListClasses.listName}>{getGroupDMName(c)}</div>
<div className={GuildLabelClasses.guildNick}>{c.recipients.length} Members</div> <div className={GuildLabelClasses.guildNick}>{c.recipients.length + 1} Members</div>
</div> </div>
</Clickable> </Clickable>
)); ));

View file

@ -24,7 +24,7 @@ import definePlugin from "@utils/types";
import { findByCodeLazy } from "@webpack"; import { findByCodeLazy } from "@webpack";
import { UserStore, useState } from "@webpack/common"; import { UserStore, useState } from "@webpack/common";
import type { User } from "discord-types/general"; import type { User } from "discord-types/general";
import type { ComponentType } from "react"; import type { ComponentType, ReactNode } from "react";
const fetching = new Set<string>(); const fetching = new Set<string>();
const queue = new Queue(5); const queue = new Queue(5);
@ -36,7 +36,7 @@ interface MentionProps {
channelId?: string; channelId?: string;
content: any; content: any;
}; };
parse: (content: any, props: MentionProps["props"]) => string[]; parse: (content: any, props: MentionProps["props"]) => ReactNode;
props: { props: {
key: string; key: string;
formatInline: boolean; formatInline: boolean;
@ -72,7 +72,7 @@ function MentionWrapper({ data, UserMention, RoleMention, parse, props }: Mentio
> >
<span <span
onMouseEnter={() => { onMouseEnter={() => {
const mention = children?.[0]; const mention = children?.[0]?.props?.children;
if (typeof mention !== "string") return; if (typeof mention !== "string") return;
const id = mention.match(/<@(\d+)>/)?.[1]; const id = mention.match(/<@(\d+)>/)?.[1];