diff --git a/src/plugins/typingTweaks/index.tsx b/src/plugins/typingTweaks/index.tsx index 8b292c1fd..ff68a4864 100644 --- a/src/plugins/typingTweaks/index.tsx +++ b/src/plugins/typingTweaks/index.tsx @@ -23,6 +23,7 @@ import { openUserProfile } from "@utils/discord"; import definePlugin, { OptionType } from "@utils/types"; import { Avatar, GuildMemberStore, React, RelationshipStore } from "@webpack/common"; import { User } from "discord-types/general"; +import { PropsWithChildren } from "react"; const settings = definePluginSettings({ showAvatars: { @@ -100,7 +101,7 @@ export default definePlugin({ { // Style the indicator and add function call to modify the children before rendering match: /(?<=children:\[(\i)\.length>0.{0,200}?"aria-atomic":!0,children:)\i(?<=guildId:(\i).+?)/, - replace: "$self.mutateChildren($2,$1,$&),style:$self.TYPING_TEXT_STYLE" + replace: "$self.renderTypingUsers({ users: $1, guildId: $2, children: $& }),style:$self.TYPING_TEXT_STYLE" }, { // Changes the indicator to keep the user object when creating the list of typing users @@ -125,7 +126,7 @@ export default definePlugin({ buildSeveralUsers, - mutateChildren(guildId: any, users: User[], children: any) { + renderTypingUsers: ErrorBoundary.wrap(({ guildId, users, children }: PropsWithChildren<{ guildId: string, users: User[]; }>) => { try { if (!Array.isArray(children)) { return children; @@ -145,5 +146,5 @@ export default definePlugin({ } return children; - } + }, { noop: true }) });