diff --git a/dist/index.js b/dist/index.js index d119c1de..0e7671f7 100644 --- a/dist/index.js +++ b/dist/index.js @@ -462,13 +462,16 @@ // messages sendNewMessage = async () => { if (this.cannotSendMessage.value == true) return; - const message = await this.createMessage(this.composingMessage.value); - this.sendExistingMessage(message); + await this.sendMessageText(this.composingMessage.value); this.composingMessage.value = ""; }; + sendMessageText = async (text) => { + const message = await this.createMessage(text); + this.sendExistingMessage(message); + }; resendMessage = (message) => { if (this.cannotResendMessage.value == true) return; - this.sendExistingMessage(message); + this.sendMessageText(message.body); }; createMessage = async (messageText) => { const secondaryChannelNames = [ diff --git a/src/Model/chatModel.ts b/src/Model/chatModel.ts index ab3658bf..ecc5d2d1 100644 --- a/src/Model/chatModel.ts +++ b/src/Model/chatModel.ts @@ -159,14 +159,18 @@ export class Chat { sendNewMessage = async (): Promise => { if (this.cannotSendMessage.value == true) return; - const message = await this.createMessage(this.composingMessage.value); - this.sendExistingMessage(message); + await this.sendMessageText(this.composingMessage.value); this.composingMessage.value = ""; }; + sendMessageText = async (text: string): Promise => { + const message = await this.createMessage(text); + this.sendExistingMessage(message); + }; + resendMessage = (message: ChatMessage) => { if (this.cannotResendMessage.value == true) return; - this.sendExistingMessage(message); + this.sendMessageText(message.body); }; createMessage = async (messageText: string): Promise => {