Fix inserting text when markdown preview is off

This commit is contained in:
Vendicated 2023-04-18 23:12:58 +02:00
parent 8be6c6e3ce
commit 8dd70f5d1a
No known key found for this signature in database
GPG key ID: A1DC0CFB5615D905
5 changed files with 19 additions and 12 deletions

View file

@ -18,8 +18,9 @@
import { addButton, removeButton } from "@api/MessagePopover";
import { Devs } from "@utils/constants";
import { insertTextIntoChatInputBox } from "@utils/discord";
import definePlugin from "@utils/types";
import { ChannelStore, ComponentDispatch } from "@webpack/common";
import { ChannelStore } from "@webpack/common";
export default definePlugin({
name: "QuickMention",
@ -34,7 +35,7 @@ export default definePlugin({
icon: this.Icon,
message: msg,
channel: ChannelStore.getChannel(msg.channel_id),
onClick: () => ComponentDispatch.dispatchToLastSubscribed("INSERT_TEXT", { rawText: `<@${msg.author.id}> ` })
onClick: () => insertTextIntoChatInputBox(`<@${msg.author.id}> `)
};
});
},