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

@ -16,6 +16,7 @@
* along with this program. If not, see <https://www.gnu.org/licenses/>.
*/
import { insertTextIntoChatInputBox } from "@utils/discord";
import {
ModalContent,
ModalFooter,
@ -24,7 +25,7 @@ import {
ModalRoot,
openModal,
} from "@utils/modal";
import { Button, ComponentDispatch, Forms, React, Switch, TextInput } from "@webpack/common";
import { Button, Forms, React, Switch, TextInput } from "@webpack/common";
import { encrypt } from "../index";
@ -84,9 +85,7 @@ function EncModal(props: ModalProps) {
const toSend = noCover ? encrypted.replaceAll("d", "") : encrypted;
if (!toSend) return;
ComponentDispatch.dispatchToLastSubscribed("INSERT_TEXT", {
rawText: `${toSend}`
});
insertTextIntoChatInputBox(toSend);
props.onClose();
}}