diff --git a/client/src/app/site/chat/components/chat-tabs/chat-tabs.component.html b/client/src/app/site/chat/components/chat-tabs/chat-tabs.component.html
index d326e7562..4ed970bd7 100644
--- a/client/src/app/site/chat/components/chat-tabs/chat-tabs.component.html
+++ b/client/src/app/site/chat/components/chat-tabs/chat-tabs.component.html
@@ -34,13 +34,15 @@
{{ 'Message' | translate }}
+
diff --git a/client/src/app/site/chat/components/chat-tabs/chat-tabs.component.ts b/client/src/app/site/chat/components/chat-tabs/chat-tabs.component.ts
index 92d21786f..cf151a822 100644
--- a/client/src/app/site/chat/components/chat-tabs/chat-tabs.component.ts
+++ b/client/src/app/site/chat/components/chat-tabs/chat-tabs.component.ts
@@ -26,6 +26,7 @@ import { ViewChatGroup } from '../../models/view-chat-group';
export class ChatTabsComponent extends BaseViewComponentDirective implements OnInit {
public chatGroupSubject: BehaviorSubject;
public newMessageForm: FormGroup;
+ public messagePending = false;
private messageControl: AbstractControl;
public chatMessageMaxLength = 512;
private selectedTabIndex = 0;
@@ -91,8 +92,12 @@ export class ChatTabsComponent extends BaseViewComponentDirective implements OnI
}
public send(): void {
+ if (this.messagePending) {
+ return;
+ }
const message = this.messageControl.value?.trim();
if (message) {
+ this.messagePending = true;
const payload = {
text: message,
chatgroup_id: this.chatGroupFromIndex.id
@@ -102,6 +107,9 @@ export class ChatTabsComponent extends BaseViewComponentDirective implements OnI
.then(() => {
this.clearTextInput();
})
+ .finally(() => {
+ this.messagePending = false;
+ })
.catch(this.raiseError);
}
}