stream-chat-angular 3.0.0 → 3.0.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1 +1 @@
1
- export declare const version = "3.0.0";
1
+ export declare const version = "3.0.1";
@@ -354,7 +354,7 @@
354
354
  return (kind === "a" ? f.call(receiver, value) : f ? f.value = value : state.set(receiver, value)), value;
355
355
  }
356
356
 
357
- var version = '3.0.0';
357
+ var version = '3.0.1';
358
358
 
359
359
  /**
360
360
  * The `NotificationService` can be used to add or remove notifications. By default the [`NotificationList`](../components/NotificationListComponent.mdx) component displays the currently active notifications.
@@ -3074,7 +3074,7 @@
3074
3074
  MessageInputComponent.prototype.messageSent = function () {
3075
3075
  var _a;
3076
3076
  return __awaiter(this, void 0, void 0, function () {
3077
- var attachmentUploadInProgressCounter, attachments, text, error_1;
3077
+ var attachmentUploadInProgressCounter, attachments, text, textContainsOnlySpaceChars, error_1;
3078
3078
  return __generator(this, function (_12) {
3079
3079
  switch (_12.label) {
3080
3080
  case 0:
@@ -3090,9 +3090,14 @@
3090
3090
  }
3091
3091
  attachments = this.attachmentService.mapToAttachments();
3092
3092
  text = this.textareaValue;
3093
- if (!text && (!attachments || attachments.length === 0)) {
3093
+ textContainsOnlySpaceChars = !text.replace(/ /g, '');
3094
+ if ((!text || textContainsOnlySpaceChars) &&
3095
+ (!attachments || attachments.length === 0)) {
3094
3096
  return [2 /*return*/];
3095
3097
  }
3098
+ if (textContainsOnlySpaceChars) {
3099
+ text = '';
3100
+ }
3096
3101
  if (this.containsLinks && !this.canSendLinks) {
3097
3102
  this.notificationService.addTemporaryNotification('streamChat.Sending links is not allowed in this conversation');
3098
3103
  return [2 /*return*/];