diff --git a/projects/ucap-webmessenger-app/src/app/layouts/messenger/components/main-contents/messages.component.ts b/projects/ucap-webmessenger-app/src/app/layouts/messenger/components/main-contents/messages.component.ts index b48a0031..cb6ae43c 100644 --- a/projects/ucap-webmessenger-app/src/app/layouts/messenger/components/main-contents/messages.component.ts +++ b/projects/ucap-webmessenger-app/src/app/layouts/messenger/components/main-contents/messages.component.ts @@ -878,6 +878,9 @@ export class MessagesComponent implements OnInit, OnDestroy, AfterViewInit { /** Send Event */ async onSendMessage(message: string) { + if (!!message || message.trim().length > 0) { + message = message.replace(/\t/g, ' '); + } this.chatMessages.initEventMore(); if (!this.selectedSticker) { @@ -2356,7 +2359,7 @@ export class MessagesComponent implements OnInit, OnDestroy, AfterViewInit { }); if (result.selected.text) { - this.onSendMessage(data.text.replace(/\t/g, ' ')); + this.onSendMessage(data.text); } if (result.selected.image) {