stream-chat-angular 4.19.0 → 4.20.0

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 = "4.19.0";
1
+ export declare const version = "4.20.0";
@@ -355,7 +355,7 @@
355
355
  return (kind === "a" ? f.call(receiver, value) : f ? f.value = value : state.set(receiver, value)), value;
356
356
  }
357
357
 
358
- var version = '4.19.0';
358
+ var version = '4.20.0';
359
359
 
360
360
  /**
361
361
  * The `NotificationService` can be used to add or remove notifications. By default the [`NotificationList`](../components/NotificationListComponent.mdx) component displays the currently active notifications.
@@ -2149,8 +2149,8 @@
2149
2149
  return __awaiter(this, void 0, void 0, function () {
2150
2150
  var imageFiles, dataFiles, videoFiles, newUploads;
2151
2151
  var _this = this;
2152
- return __generator(this, function (_d) {
2153
- switch (_d.label) {
2152
+ return __generator(this, function (_e) {
2153
+ switch (_e.label) {
2154
2154
  case 0:
2155
2155
  if (!fileList) {
2156
2156
  return [2 /*return*/];
@@ -2186,7 +2186,7 @@
2186
2186
  this.attachmentUploadsSubject.next(__spreadArray(__spreadArray([], __read(this.attachmentUploadsSubject.getValue())), __read(newUploads)));
2187
2187
  return [4 /*yield*/, this.uploadAttachments(newUploads)];
2188
2188
  case 1:
2189
- _d.sent();
2189
+ _e.sent();
2190
2190
  return [2 /*return*/];
2191
2191
  }
2192
2192
  });
@@ -2211,8 +2211,8 @@
2211
2211
  AttachmentService.prototype.retryAttachmentUpload = function (file) {
2212
2212
  return __awaiter(this, void 0, void 0, function () {
2213
2213
  var attachmentUploads, upload;
2214
- return __generator(this, function (_d) {
2215
- switch (_d.label) {
2214
+ return __generator(this, function (_e) {
2215
+ switch (_e.label) {
2216
2216
  case 0:
2217
2217
  attachmentUploads = this.attachmentUploadsSubject.getValue();
2218
2218
  upload = attachmentUploads.find(function (u) { return u.file === file; });
@@ -2223,7 +2223,7 @@
2223
2223
  this.attachmentUploadsSubject.next(__spreadArray([], __read(attachmentUploads)));
2224
2224
  return [4 /*yield*/, this.uploadAttachments([upload])];
2225
2225
  case 1:
2226
- _d.sent();
2226
+ _e.sent();
2227
2227
  return [2 /*return*/];
2228
2228
  }
2229
2229
  });
@@ -2237,24 +2237,24 @@
2237
2237
  var _a;
2238
2238
  return __awaiter(this, void 0, void 0, function () {
2239
2239
  var attachmentUploads, result, index, error_1, index;
2240
- return __generator(this, function (_d) {
2241
- switch (_d.label) {
2240
+ return __generator(this, function (_e) {
2241
+ switch (_e.label) {
2242
2242
  case 0:
2243
2243
  attachmentUploads = this.attachmentUploadsSubject.getValue();
2244
2244
  if (!(upload.state === 'success' &&
2245
2245
  !((_a = upload.fromAttachment) === null || _a === void 0 ? void 0 : _a.isCustomAttachment))) return [3 /*break*/, 5];
2246
- _d.label = 1;
2246
+ _e.label = 1;
2247
2247
  case 1:
2248
- _d.trys.push([1, 3, , 4]);
2248
+ _e.trys.push([1, 3, , 4]);
2249
2249
  return [4 /*yield*/, this.channelService.deleteAttachment(upload)];
2250
2250
  case 2:
2251
- _d.sent();
2251
+ _e.sent();
2252
2252
  result = __spreadArray([], __read(attachmentUploads));
2253
2253
  index = attachmentUploads.indexOf(upload);
2254
2254
  result.splice(index, 1);
2255
2255
  return [3 /*break*/, 4];
2256
2256
  case 3:
2257
- error_1 = _d.sent();
2257
+ error_1 = _e.sent();
2258
2258
  result = attachmentUploads;
2259
2259
  this.notificationService.addTemporaryNotification('streamChat.Error deleting attachment');
2260
2260
  return [3 /*break*/, 4];
@@ -2263,7 +2263,7 @@
2263
2263
  result = __spreadArray([], __read(attachmentUploads));
2264
2264
  index = attachmentUploads.indexOf(upload);
2265
2265
  result.splice(index, 1);
2266
- _d.label = 6;
2266
+ _e.label = 6;
2267
2267
  case 6:
2268
2268
  this.attachmentUploadsSubject.next(__spreadArray([], __read(result)));
2269
2269
  return [2 /*return*/];
@@ -2280,7 +2280,7 @@
2280
2280
  return attachmentUploads
2281
2281
  .filter(function (r) { return r.state === 'success'; })
2282
2282
  .map(function (r) {
2283
- var _a, _b, _c;
2283
+ var _a, _b, _c, _d;
2284
2284
  var attachment = {
2285
2285
  type: r.type,
2286
2286
  };
@@ -2288,14 +2288,15 @@
2288
2288
  return r.fromAttachment;
2289
2289
  }
2290
2290
  else {
2291
+ attachment.mime_type = (_a = r.file) === null || _a === void 0 ? void 0 : _a.type;
2291
2292
  if (r.type === 'image') {
2292
- attachment.fallback = (_a = r.file) === null || _a === void 0 ? void 0 : _a.name;
2293
+ attachment.fallback = (_b = r.file) === null || _b === void 0 ? void 0 : _b.name;
2293
2294
  attachment.image_url = r.url;
2294
2295
  }
2295
2296
  else {
2296
2297
  attachment.asset_url = r.url;
2297
- attachment.title = (_b = r.file) === null || _b === void 0 ? void 0 : _b.name;
2298
- attachment.file_size = (_c = r.file) === null || _c === void 0 ? void 0 : _c.size;
2298
+ attachment.title = (_c = r.file) === null || _c === void 0 ? void 0 : _c.name;
2299
+ attachment.file_size = (_d = r.file) === null || _d === void 0 ? void 0 : _d.size;
2299
2300
  attachment.thumb_url = r.thumb_url;
2300
2301
  }
2301
2302
  }
@@ -2318,6 +2319,7 @@
2318
2319
  type: 'image',
2319
2320
  file: {
2320
2321
  name: attachment.fallback,
2322
+ type: attachment.mime_type,
2321
2323
  },
2322
2324
  fromAttachment: attachment,
2323
2325
  });
@@ -2329,6 +2331,7 @@
2329
2331
  file: {
2330
2332
  name: attachment.title,
2331
2333
  size: attachment.file_size,
2334
+ type: attachment.mime_type,
2332
2335
  },
2333
2336
  type: attachment.type,
2334
2337
  thumb_url: attachment.thumb_url,
@@ -2359,13 +2362,13 @@
2359
2362
  return __awaiter(this, void 0, void 0, function () {
2360
2363
  var result, attachmentUploads;
2361
2364
  var _this = this;
2362
- return __generator(this, function (_d) {
2363
- switch (_d.label) {
2365
+ return __generator(this, function (_e) {
2366
+ switch (_e.label) {
2364
2367
  case 0:
2365
2368
  this.attachmentUploadInProgressCounterSubject.next(this.attachmentUploadInProgressCounterSubject.getValue() + 1);
2366
2369
  return [4 /*yield*/, this.channelService.uploadAttachments(uploads)];
2367
2370
  case 1:
2368
- result = _d.sent();
2371
+ result = _e.sent();
2369
2372
  attachmentUploads = this.attachmentUploadsSubject.getValue();
2370
2373
  result.forEach(function (r) {
2371
2374
  var upload = attachmentUploads.find(function (upload) { return upload.file === r.file; });