Skip to content

Commit ae13034

Browse files
author
Gabriele Panico
committed
changed: block to send message on keypress if not allowed
1 parent 61a0627 commit ae13034

File tree

1 file changed

+11
-0
lines changed

1 file changed

+11
-0
lines changed

src/app/component/conversation-detail/conversation-footer/conversation-footer.component.ts

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -356,6 +356,11 @@ export class ConversationFooterComponent implements OnInit, OnChanges {
356356
return
357357
}
358358

359+
let check = this.checkForEmojii(this.textInputTextArea)
360+
if(!check){
361+
return;
362+
}
363+
359364
if (msg && msg.trim() !== '' || type === TYPE_MSG_IMAGE || type === TYPE_MSG_FILE ) {
360365

361366
// msg = htmlEntities(msg);
@@ -596,6 +601,9 @@ export class ConversationFooterComponent implements OnInit, OnChanges {
596601

597602
onSendPressed(event) {
598603
this.logger.log('[CONV-FOOTER] onSendPressed:event', event);
604+
if(this.showAlertEmoji || this.showAlertUrl){
605+
return;
606+
}
599607
event.preventDefault();
600608
this.logger.log('[CONV-FOOTER] AppComponent::onSendPressed::isFilePendingToUpload:', this.isFilePendingToUpload);
601609
if (this.isFilePendingToUpload) {
@@ -724,6 +732,9 @@ export class ConversationFooterComponent implements OnInit, OnChanges {
724732
const keyCode = event.which || event.keyCode;
725733
this.textInputTextArea = ((document.getElementById('chat21-main-message-context') as HTMLInputElement).value);
726734
if (keyCode === 13) { // ENTER pressed
735+
if(this.showAlertEmoji || this.showAlertUrl){
736+
return;
737+
}
727738
if (this.textInputTextArea && this.textInputTextArea.trim() !== '') {
728739
// that.logger.log('[CONV-FOOTER] sendMessage -> ', this.textInputTextArea);
729740
// this.resizeInputField();

0 commit comments

Comments
 (0)