@twilio/conversations 2.6.0-rc.0 → 2.6.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.
package/builds/browser.js CHANGED
@@ -154,10 +154,10 @@ var _getPrototypeOf = require('@babel/runtime/helpers/getPrototypeOf');
154
154
  var _defineProperty = require('@babel/runtime/helpers/defineProperty');
155
155
  var _createClass = require('@babel/runtime/helpers/createClass');
156
156
  var _classCallCheck = require('@babel/runtime/helpers/classCallCheck');
157
- require('core-js/modules/es.object.to-string.js');
158
- require('core-js/modules/es.promise.js');
159
157
  require('core-js/modules/es.array.map.js');
158
+ require('core-js/modules/es.object.to-string.js');
160
159
  require('core-js/modules/web.dom-collections.for-each.js');
160
+ require('core-js/modules/es.promise.js');
161
161
  var _regeneratorRuntime = require('@babel/runtime/regenerator');
162
162
  var _typeof = require('@babel/runtime/helpers/typeof');
163
163
  require('core-js/modules/es.array.concat.js');
@@ -8064,7 +8064,7 @@ function PushNotification(data) {
8064
8064
  this.data = data.data || {};
8065
8065
  });
8066
8066
 
8067
- var version = "2.6.0-rc.0";
8067
+ var version = "2.6.0";
8068
8068
 
8069
8069
  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; }
8070
8070
 
@@ -9585,6 +9585,8 @@ exports.Client = Client_1 = (_class = /*#__PURE__*/function (_ReplayEventEmitter
9585
9585
  terminal: true,
9586
9586
  message: "Twilsock has disconnected."
9587
9587
  });
9588
+
9589
+ _this._initializeEnsureReady((options === null || options === void 0 ? void 0 : options.throwErrorsAlways) || false);
9588
9590
  };
9589
9591
 
9590
9592
  _this._services.twilsockClient.once("connectionError", emitFailed);
@@ -9642,12 +9644,7 @@ exports.Client = Client_1 = (_class = /*#__PURE__*/function (_ReplayEventEmitter
9642
9644
  }, _callee, null, [[3, 11]]);
9643
9645
  })));
9644
9646
 
9645
- _this._ensureReady = new Promise(function (resolve, reject) {
9646
- _this._resolveEnsureReady = resolve;
9647
- _this._rejectEnsureReady = reject;
9648
- }).catch(function () {
9649
- return void 0;
9650
- }); // @todo How to process unhandled rejection here?
9647
+ _this._initializeEnsureReady((options === null || options === void 0 ? void 0 : options.throwErrorsAlways) || false);
9651
9648
 
9652
9649
  if (startTwilsock) {
9653
9650
  _this._services.twilsockClient.connect();
@@ -10540,6 +10537,26 @@ exports.Client = Client_1 = (_class = /*#__PURE__*/function (_ReplayEventEmitter
10540
10537
  _this5._services.notificationClient.unsubscribe(channelType, messageType);
10541
10538
  });
10542
10539
  }
10540
+ /**
10541
+ * Initialize the ensureReady promise.
10542
+ */
10543
+
10544
+ }, {
10545
+ key: "_initializeEnsureReady",
10546
+ value: function _initializeEnsureReady(throwErrorsAlways) {
10547
+ var _this6 = this;
10548
+
10549
+ this._ensureReady = new Promise(function (resolve, reject) {
10550
+ _this6._resolveEnsureReady = resolve;
10551
+ _this6._rejectEnsureReady = reject;
10552
+ }).catch(function (error) {
10553
+ if (throwErrorsAlways) {
10554
+ throw error;
10555
+ } else {
10556
+ return void 0;
10557
+ }
10558
+ });
10559
+ }
10543
10560
  }], [{
10544
10561
  key: "create",
10545
10562
  value: function () {