@twilio/conversations 2.4.1-rc.0 → 2.4.1-rc.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.
package/builds/browser.js CHANGED
@@ -2200,10 +2200,12 @@ var Media = /*#__PURE__*/function () {
2200
2200
  while (1) {
2201
2201
  switch (_context.prev = _context.next) {
2202
2202
  case 0:
2203
- fetchMediaRequest = _this._fetchMcsMedia();
2203
+ fetchMediaRequest = _this.mcsMedia ? undefined : _this._fetchMcsMedia();
2204
2204
  contentUrlRequest = (_this$mcsMedia = _this.mcsMedia) === null || _this$mcsMedia === void 0 ? void 0 : _this$mcsMedia.getContentUrl();
2205
2205
  onCancel(function () {
2206
- fetchMediaRequest.cancel();
2206
+ if (fetchMediaRequest) {
2207
+ fetchMediaRequest.cancel();
2208
+ }
2207
2209
 
2208
2210
  if (contentUrlRequest) {
2209
2211
  contentUrlRequest.cancel();
@@ -2211,7 +2213,7 @@ var Media = /*#__PURE__*/function () {
2211
2213
  });
2212
2214
  _context.prev = 3;
2213
2215
 
2214
- if (_this.mcsMedia) {
2216
+ if (contentUrlRequest) {
2215
2217
  _context.next = 9;
2216
2218
  break;
2217
2219
  }
@@ -2221,7 +2223,7 @@ var Media = /*#__PURE__*/function () {
2221
2223
 
2222
2224
  case 7:
2223
2225
  mcsMedia = _context.sent;
2224
- contentUrlRequest = mcsMedia.getContentUrl();
2226
+ contentUrlRequest = mcsMedia === null || mcsMedia === void 0 ? void 0 : mcsMedia.getContentUrl();
2225
2227
 
2226
2228
  case 9:
2227
2229
  _context.t0 = resolve;
@@ -2278,13 +2280,11 @@ var Media = /*#__PURE__*/function () {
2278
2280
  while (1) {
2279
2281
  switch (_context2.prev = _context2.next) {
2280
2282
  case 0:
2281
- request = _this2.services.mcsClient.get(_this2.state.sid);
2282
-
2283
- if (!_this2.services.mcsClient) {
2284
- _context2.next = 14;
2285
- break;
2283
+ if (_this2.services.mcsClient === null) {
2284
+ reject(new Error("Media Content Service is unavailable"));
2286
2285
  }
2287
2286
 
2287
+ request = _this2.services.mcsClient.get(_this2.state.sid);
2288
2288
  onCancel(function () {
2289
2289
  return request.cancel();
2290
2290
  });
@@ -2294,27 +2294,22 @@ var Media = /*#__PURE__*/function () {
2294
2294
 
2295
2295
  case 6:
2296
2296
  _this2.mcsMedia = _context2.sent;
2297
+ _this2.state = _this2.mcsMedia._state();
2297
2298
  resolve(_this2.mcsMedia);
2298
- _context2.next = 13;
2299
+ _context2.next = 14;
2299
2300
  break;
2300
2301
 
2301
- case 10:
2302
- _context2.prev = 10;
2302
+ case 11:
2303
+ _context2.prev = 11;
2303
2304
  _context2.t0 = _context2["catch"](3);
2304
2305
  reject(_context2.t0);
2305
2306
 
2306
- case 13:
2307
- return _context2.abrupt("return");
2308
-
2309
2307
  case 14:
2310
- reject(new Error("Media Content Service is unavailable"));
2311
-
2312
- case 15:
2313
2308
  case "end":
2314
2309
  return _context2.stop();
2315
2310
  }
2316
2311
  }
2317
- }, _callee2, null, [[3, 10]]);
2312
+ }, _callee2, null, [[3, 11]]);
2318
2313
  }));
2319
2314
 
2320
2315
  return function (_x4, _x5, _x6) {
@@ -2329,7 +2324,7 @@ var Media = /*#__PURE__*/function () {
2329
2324
  }, {
2330
2325
  key: "_state",
2331
2326
  value: function _state() {
2332
- return this.mcsMedia ? this.mcsMedia._state() : this.state;
2327
+ return this.state;
2333
2328
  }
2334
2329
  }]);
2335
2330
 
@@ -7892,7 +7887,7 @@ function PushNotification(data) {
7892
7887
  this.data = data.data || {};
7893
7888
  });
7894
7889
 
7895
- var version = "2.4.1-rc.0";
7890
+ var version = "2.4.1-rc.1";
7896
7891
 
7897
7892
  function ownKeys$1(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
7898
7893