From 394d2060eb90e5d7104798026fa8a18a02a24d93 Mon Sep 17 00:00:00 2001 From: AutumnVN Date: Thu, 9 Nov 2023 08:34:40 +0700 Subject: [PATCH] searchReply: fix (#1961) --- src/plugins/searchReply/index.tsx | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/plugins/searchReply/index.tsx b/src/plugins/searchReply/index.tsx index b28ca8ec4..b151712af 100644 --- a/src/plugins/searchReply/index.tsx +++ b/src/plugins/searchReply/index.tsx @@ -20,12 +20,12 @@ import { addContextMenuPatch, findGroupChildrenByChildId, NavContextMenuPatchCal import { ReplyIcon } from "@components/Icons"; import { Devs } from "@utils/constants"; import definePlugin from "@utils/types"; -import { findByCodeLazy } from "@webpack"; +import { findByPropsLazy } from "@webpack"; import { ChannelStore, i18n, Menu, PermissionsBits, PermissionStore, SelectedChannelStore } from "@webpack/common"; import { Message } from "discord-types/general"; -const replyFn = findByCodeLazy("showMentionToggle", "TEXTAREA_FOCUS", "shiftKey"); +const messageUtils = findByPropsLazy("replyToMessage"); const messageContextMenuPatch: NavContextMenuPatchCallback = (children, { message }: { message: Message; }) => () => { // make sure the message is in the selected channel @@ -43,7 +43,7 @@ const messageContextMenuPatch: NavContextMenuPatchCallback = (children, { messag id="reply" label={i18n.Messages.MESSAGE_ACTION_REPLY} icon={ReplyIcon} - action={(e: React.MouseEvent) => replyFn(channel, message, e)} + action={(e: React.MouseEvent) => messageUtils.replyToMessage(channel, message, e)} /> )); } @@ -56,7 +56,7 @@ const messageContextMenuPatch: NavContextMenuPatchCallback = (children, { messag id="reply" label={i18n.Messages.MESSAGE_ACTION_REPLY} icon={ReplyIcon} - action={(e: React.MouseEvent) => replyFn(channel, message, e)} + action={(e: React.MouseEvent) => messageUtils.replyToMessage(channel, message, e)} /> )); }