@atlaskit/emoji 70.10.9 → 70.10.11

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.
@@ -20,7 +20,7 @@ var createEvent = function createEvent(eventType, action, actionSubject, actionS
20
20
  actionSubjectId: actionSubjectId,
21
21
  attributes: _objectSpread({
22
22
  packageName: "@atlaskit/emoji",
23
- packageVersion: "70.10.8"
23
+ packageVersion: "70.10.10"
24
24
  }, attributes)
25
25
  };
26
26
  };
@@ -76,18 +76,18 @@ var withSampling = exports.withSampling = function withSampling(ufoExperience) {
76
76
  var start = /*#__PURE__*/function () {
77
77
  var _ref = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee(options) {
78
78
  var isSampled;
79
- return _regenerator.default.wrap(function _callee$(_context) {
79
+ return _regenerator.default.wrap(function (_context) {
80
80
  while (1) switch (_context.prev = _context.next) {
81
81
  case 0:
82
82
  if (!hasSampledFromStart(ufoExperience)) {
83
- _context.next = 2;
83
+ _context.next = 1;
84
84
  break;
85
85
  }
86
86
  return _context.abrupt("return");
87
- case 2:
87
+ case 1:
88
88
  isSampled = options.samplingFunc || isExperienceSampled;
89
89
  if (isSampled(options.samplingRate)) {
90
- _context.next = 7;
90
+ _context.next = 2;
91
91
  break;
92
92
  }
93
93
  if (ufoExperience.instanceId) {
@@ -95,14 +95,14 @@ var withSampling = exports.withSampling = function withSampling(ufoExperience) {
95
95
  }
96
96
  ufoExperiencesSampled[ufoExperience.id].sampled = false;
97
97
  return _context.abrupt("return");
98
- case 7:
98
+ case 2:
99
99
  // update sampled records
100
100
  if (ufoExperience.instanceId) {
101
101
  ufoExperiencesSampled[ufoExperience.id].sampledInstance[ufoExperience.instanceId] = true;
102
102
  ufoExperiencesSampled[ufoExperience.id].sampled = true;
103
103
  }
104
104
  return _context.abrupt("return", ufoExperience.start(options.startTime));
105
- case 9:
105
+ case 3:
106
106
  case "end":
107
107
  return _context.stop();
108
108
  }
@@ -114,17 +114,17 @@ var withSampling = exports.withSampling = function withSampling(ufoExperience) {
114
114
  }();
115
115
  var success = /*#__PURE__*/function () {
116
116
  var _ref2 = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee2(config) {
117
- return _regenerator.default.wrap(function _callee2$(_context2) {
117
+ return _regenerator.default.wrap(function (_context2) {
118
118
  while (1) switch (_context2.prev = _context2.next) {
119
119
  case 0:
120
120
  if (hasSampledFromStart(ufoExperience)) {
121
- _context2.next = 2;
121
+ _context2.next = 1;
122
122
  break;
123
123
  }
124
124
  return _context2.abrupt("return", null);
125
- case 2:
125
+ case 1:
126
126
  return _context2.abrupt("return", ufoExperience.success(config));
127
- case 3:
127
+ case 2:
128
128
  case "end":
129
129
  return _context2.stop();
130
130
  }
@@ -136,17 +136,17 @@ var withSampling = exports.withSampling = function withSampling(ufoExperience) {
136
136
  }();
137
137
  var failure = /*#__PURE__*/function () {
138
138
  var _ref3 = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee3(config) {
139
- return _regenerator.default.wrap(function _callee3$(_context3) {
139
+ return _regenerator.default.wrap(function (_context3) {
140
140
  while (1) switch (_context3.prev = _context3.next) {
141
141
  case 0:
142
142
  if (hasSampledFromStart(ufoExperience)) {
143
- _context3.next = 2;
143
+ _context3.next = 1;
144
144
  break;
145
145
  }
146
146
  return _context3.abrupt("return", null);
147
- case 2:
147
+ case 1:
148
148
  return _context3.abrupt("return", ufoExperience.failure(config));
149
- case 3:
149
+ case 2:
150
150
  case "end":
151
151
  return _context3.stop();
152
152
  }
@@ -158,17 +158,17 @@ var withSampling = exports.withSampling = function withSampling(ufoExperience) {
158
158
  }();
159
159
  var abort = /*#__PURE__*/function () {
160
160
  var _ref4 = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee4(config) {
161
- return _regenerator.default.wrap(function _callee4$(_context4) {
161
+ return _regenerator.default.wrap(function (_context4) {
162
162
  while (1) switch (_context4.prev = _context4.next) {
163
163
  case 0:
164
164
  if (hasSampledFromStart(ufoExperience)) {
165
- _context4.next = 2;
165
+ _context4.next = 1;
166
166
  break;
167
167
  }
168
168
  return _context4.abrupt("return", null);
169
- case 2:
169
+ case 1:
170
170
  return _context4.abrupt("return", ufoExperience.abort(config));
171
- case 3:
171
+ case 2:
172
172
  case "end":
173
173
  return _context4.stop();
174
174
  }
@@ -9,7 +9,7 @@ const createEvent = (eventType, action, actionSubject, actionSubjectId, attribut
9
9
  actionSubjectId,
10
10
  attributes: {
11
11
  packageName: "@atlaskit/emoji",
12
- packageVersion: "70.10.8",
12
+ packageVersion: "70.10.10",
13
13
  ...attributes
14
14
  }
15
15
  });
@@ -39,7 +39,7 @@ export var supportsUploadFeature = function supportsUploadFeature(emojiProvider)
39
39
  var emojiUploadProvider = emojiProvider;
40
40
  return !!emojiUploadProvider.isUploadSupported && !!emojiUploadProvider.uploadCustomEmoji && !!emojiUploadProvider.prepareForUpload;
41
41
  };
42
- export var EmojiResource = /*#__PURE__*/function (_ref) {
42
+ export var EmojiResource = /*#__PURE__*/function (_AbstractResource) {
43
43
  function EmojiResource(config) {
44
44
  var _this;
45
45
  _classCallCheck(this, EmojiResource);
@@ -103,41 +103,42 @@ export var EmojiResource = /*#__PURE__*/function (_ref) {
103
103
  * Get the emoji provider from Emoji Resource
104
104
  * @returns Promise<EmojiProvider>
105
105
  */
106
- _inherits(EmojiResource, _ref);
106
+ _inherits(EmojiResource, _AbstractResource);
107
107
  return _createClass(EmojiResource, [{
108
108
  key: "getEmojiProvider",
109
109
  value: (function () {
110
110
  var _getEmojiProvider = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee() {
111
111
  var options,
112
- _args = arguments;
113
- return _regeneratorRuntime.wrap(function _callee$(_context) {
112
+ _args = arguments,
113
+ _t;
114
+ return _regeneratorRuntime.wrap(function (_context) {
114
115
  while (1) switch (_context.prev = _context.next) {
115
116
  case 0:
116
117
  options = _args.length > 0 && _args[0] !== undefined ? _args[0] : {
117
118
  fetchAtStart: !this.fetchOnDemand
118
119
  };
119
120
  if (!options.fetchAtStart) {
120
- _context.next = 11;
121
+ _context.next = 4;
121
122
  break;
122
123
  }
123
- _context.prev = 2;
124
- _context.next = 5;
124
+ _context.prev = 1;
125
+ _context.next = 2;
125
126
  return this.fetchEmojiProvider();
126
- case 5:
127
- _context.next = 11;
127
+ case 2:
128
+ _context.next = 4;
128
129
  break;
129
- case 7:
130
- _context.prev = 7;
131
- _context.t0 = _context["catch"](2);
132
- debug(_context.t0);
130
+ case 3:
131
+ _context.prev = 3;
132
+ _t = _context["catch"](1);
133
+ debug(_t);
133
134
  return _context.abrupt("return", Promise.resolve(this));
134
- case 11:
135
+ case 4:
135
136
  return _context.abrupt("return", Promise.resolve(this));
136
- case 12:
137
+ case 5:
137
138
  case "end":
138
139
  return _context.stop();
139
140
  }
140
- }, _callee, this, [[2, 7]]);
141
+ }, _callee, this, [[1, 3]]);
141
142
  }));
142
143
  function getEmojiProvider() {
143
144
  return _getEmojiProvider.apply(this, arguments);
@@ -148,8 +149,8 @@ export var EmojiResource = /*#__PURE__*/function (_ref) {
148
149
  key: "fetchIndividualProvider",
149
150
  value: function () {
150
151
  var _fetchIndividualProvider = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee2(provider, index) {
151
- var providerType, loader, emojiResponse;
152
- return _regeneratorRuntime.wrap(function _callee2$(_context2) {
152
+ var providerType, loader, emojiResponse, _t2;
153
+ return _regeneratorRuntime.wrap(function (_context2) {
153
154
  while (1) switch (_context2.prev = _context2.next) {
154
155
  case 0:
155
156
  providerType = this.getProviderType(provider);
@@ -161,41 +162,41 @@ export var EmojiResource = /*#__PURE__*/function (_ref) {
161
162
  type: providerType
162
163
  });
163
164
  loader = new EmojiLoader(provider); // fetch emoji from provider url and denormalise
164
- _context2.next = 7;
165
+ _context2.next = 2;
165
166
  return loader.loadEmoji();
166
- case 7:
167
+ case 2:
167
168
  emojiResponse = _context2.sent;
168
169
  sampledUfoEmojiResourceFetched(providerType).success();
169
170
  // setup emoji repository
170
171
  this.emojiResponses[index] = emojiResponse;
171
172
  this.initEmojiRepository(this.emojiResponses);
172
- _context2.next = 13;
173
+ _context2.next = 3;
173
174
  return this.initSiteEmojiResource(emojiResponse, provider);
174
- case 13:
175
+ case 3:
175
176
  this.activeLoaders--;
176
177
  this.performRetries();
177
178
  this.refreshLastFilter();
178
- _context2.next = 25;
179
+ _context2.next = 5;
179
180
  break;
180
- case 18:
181
- _context2.prev = 18;
182
- _context2.t0 = _context2["catch"](1);
181
+ case 4:
182
+ _context2.prev = 4;
183
+ _t2 = _context2["catch"](1);
183
184
  this.activeLoaders--;
184
- this.notifyError(_context2.t0);
185
+ this.notifyError(_t2);
185
186
  sampledUfoEmojiResourceFetched(providerType).failure({
186
187
  metadata: {
187
- reason: _context2.t0,
188
+ reason: _t2,
188
189
  source: 'EmojiProvider',
189
190
  providerUrl: provider.url
190
191
  }
191
192
  });
192
- debug("failed to fetch emoji provider for ".concat(provider.url), _context2.t0);
193
+ debug("failed to fetch emoji provider for ".concat(provider.url), _t2);
193
194
  throw new Error("failed to fetch emoji from ".concat(provider.url));
194
- case 25:
195
+ case 5:
195
196
  case "end":
196
197
  return _context2.stop();
197
198
  }
198
- }, _callee2, this, [[1, 18]]);
199
+ }, _callee2, this, [[1, 4]]);
199
200
  }));
200
201
  function fetchIndividualProvider(_x, _x2) {
201
202
  return _fetchIndividualProvider.apply(this, arguments);
@@ -209,24 +210,24 @@ export var EmojiResource = /*#__PURE__*/function (_ref) {
209
210
  var _this2 = this;
210
211
  var force,
211
212
  _args3 = arguments;
212
- return _regeneratorRuntime.wrap(function _callee3$(_context3) {
213
+ return _regeneratorRuntime.wrap(function (_context3) {
213
214
  while (1) switch (_context3.prev = _context3.next) {
214
215
  case 0:
215
216
  force = _args3.length > 0 && _args3[0] !== undefined ? _args3[0] : false;
216
217
  if (!(force || !this.isRepositoryAvailable(this.emojiRepository) && !this.isInitialised)) {
217
- _context3.next = 6;
218
+ _context3.next = 1;
218
219
  break;
219
220
  }
220
221
  this.isInitialised = true;
221
222
  this.emojiResponses = [];
222
223
  // fetch emoji providers
223
- _context3.next = 6;
224
+ _context3.next = 1;
224
225
  return Promise.all(this.emojiProviderConfig.providers.map(function (provider, index) {
225
226
  return _this2.fetchIndividualProvider(provider, index);
226
227
  }));
227
- case 6:
228
+ case 1:
228
229
  return _context3.abrupt("return", Promise.resolve(this.emojiRepository));
229
- case 7:
230
+ case 2:
230
231
  case "end":
231
232
  return _context3.stop();
232
233
  }
@@ -246,29 +247,29 @@ export var EmojiResource = /*#__PURE__*/function (_ref) {
246
247
  key: "fetchByEmojiId",
247
248
  value: function () {
248
249
  var _fetchByEmojiId = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee4(emojiId, optimistic) {
249
- var _emoji, provider, loader, loadEmoji, _emoji2, emoji;
250
- return _regeneratorRuntime.wrap(function _callee4$(_context4) {
250
+ var _emoji, provider, loader, loadEmoji, _emoji2, emoji, _t3;
251
+ return _regeneratorRuntime.wrap(function (_context4) {
251
252
  while (1) switch (_context4.prev = _context4.next) {
252
253
  case 0:
253
254
  if (!(this.isLoaded() && this.isRepositoryAvailable(this.emojiRepository))) {
254
- _context4.next = 8;
255
+ _context4.next = 3;
255
256
  break;
256
257
  }
257
- _context4.next = 3;
258
+ _context4.next = 1;
258
259
  return this.findByEmojiId(emojiId);
259
- case 3:
260
+ case 1:
260
261
  _emoji = _context4.sent;
261
262
  if (!_emoji) {
262
- _context4.next = 8;
263
+ _context4.next = 3;
263
264
  break;
264
265
  }
265
- _context4.next = 7;
266
+ _context4.next = 2;
266
267
  return this.getMediaEmojiDescriptionURLWithInlineToken(_emoji);
267
- case 7:
268
+ case 2:
268
269
  return _context4.abrupt("return", _context4.sent);
269
- case 8:
270
+ case 3:
270
271
  if (!(this.emojiProviderConfig.singleEmojiApi && optimistic)) {
271
- _context4.next = 31;
272
+ _context4.next = 11;
272
273
  break;
273
274
  }
274
275
  // if config has singleEmojiApi then fetch single emoji
@@ -277,56 +278,56 @@ export var EmojiResource = /*#__PURE__*/function (_ref) {
277
278
  securityProvider: this.emojiProviderConfig.singleEmojiApi.securityProvider
278
279
  };
279
280
  loader = new EmojiLoader(provider);
280
- _context4.prev = 11;
281
- _context4.next = 14;
281
+ _context4.prev = 4;
282
+ _context4.next = 5;
282
283
  return loader.loadEmoji();
283
- case 14:
284
+ case 5:
284
285
  loadEmoji = _context4.sent;
285
286
  if (loadEmoji.emojis[0]) {
286
- _context4.next = 17;
287
+ _context4.next = 6;
287
288
  break;
288
289
  }
289
290
  return _context4.abrupt("return");
290
- case 17:
291
+ case 6:
291
292
  if (this.isRepositoryAvailable(this.siteEmojiResource)) {
292
- _context4.next = 20;
293
+ _context4.next = 7;
293
294
  break;
294
295
  }
295
- _context4.next = 20;
296
+ _context4.next = 7;
296
297
  return this.initSiteEmojiResource(loadEmoji, provider);
297
- case 20:
298
+ case 7:
298
299
  return _context4.abrupt("return", this.getMediaEmojiDescriptionURLWithInlineToken(loadEmoji.emojis[0]));
299
- case 23:
300
- _context4.prev = 23;
301
- _context4.t0 = _context4["catch"](11);
302
- _context4.next = 27;
300
+ case 8:
301
+ _context4.prev = 8;
302
+ _t3 = _context4["catch"](4);
303
+ _context4.next = 9;
303
304
  return this.findByEmojiId(emojiId);
304
- case 27:
305
+ case 9:
305
306
  _emoji2 = _context4.sent;
306
307
  if (_emoji2) {
307
- _context4.next = 30;
308
+ _context4.next = 10;
308
309
  break;
309
310
  }
310
311
  return _context4.abrupt("return");
311
- case 30:
312
+ case 10:
312
313
  return _context4.abrupt("return", this.getMediaEmojiDescriptionURLWithInlineToken(_emoji2));
313
- case 31:
314
- _context4.next = 33;
314
+ case 11:
315
+ _context4.next = 12;
315
316
  return this.findByEmojiId(emojiId);
316
- case 33:
317
+ case 12:
317
318
  emoji = _context4.sent;
318
319
  if (emoji) {
319
- _context4.next = 36;
320
+ _context4.next = 13;
320
321
  break;
321
322
  }
322
323
  return _context4.abrupt("return");
323
- case 36:
324
+ case 13:
324
325
  return _context4.abrupt("return", this.getMediaEmojiDescriptionURLWithInlineToken(emoji));
325
- case 37:
326
+ case 14:
326
327
  case "end":
327
328
  return _context4.stop();
328
329
  }
329
- }, _callee4, this, [[11, 23]]);
330
+ }, _callee4, this, [[4, 8]]);
330
331
  }));
331
332
  function fetchByEmojiId(_x3, _x4) {
332
333
  return _fetchByEmojiId.apply(this, arguments);
@@ -451,16 +452,16 @@ export var EmojiResource = /*#__PURE__*/function (_ref) {
451
452
  value: (function () {
452
453
  var _getMediaEmojiDescriptionURLWithInlineToken = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee5(emoji) {
453
454
  var _yield$this$siteEmoji, representation, altRepresentation;
454
- return _regeneratorRuntime.wrap(function _callee5$(_context5) {
455
+ return _regeneratorRuntime.wrap(function (_context5) {
455
456
  while (1) switch (_context5.prev = _context5.next) {
456
457
  case 0:
457
458
  if (!this.isRepositoryAvailable(this.siteEmojiResource)) {
458
- _context5.next = 7;
459
+ _context5.next = 2;
459
460
  break;
460
461
  }
461
- _context5.next = 3;
462
+ _context5.next = 1;
462
463
  return this.siteEmojiResource.generateTokenisedMediaURLS(emoji.representation, emoji.altRepresentation);
463
- case 3:
464
+ case 1:
464
465
  _yield$this$siteEmoji = _context5.sent;
465
466
  representation = _yield$this$siteEmoji.representation;
466
467
  altRepresentation = _yield$this$siteEmoji.altRepresentation;
@@ -468,9 +469,9 @@ export var EmojiResource = /*#__PURE__*/function (_ref) {
468
469
  representation: representation,
469
470
  altRepresentation: altRepresentation
470
471
  }));
471
- case 7:
472
+ case 2:
472
473
  return _context5.abrupt("return", emoji);
473
- case 8:
474
+ case 3:
474
475
  case "end":
475
476
  return _context5.stop();
476
477
  }
@@ -73,23 +73,23 @@ var SiteEmojiResource = /*#__PURE__*/function () {
73
73
  key: "generateTokenisedMediaURLS",
74
74
  value: (function () {
75
75
  var _generateTokenisedMediaURLS = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee(representation, altRepresentation) {
76
- var readToken;
77
- return _regeneratorRuntime.wrap(function _callee$(_context) {
76
+ var readToken, _t;
77
+ return _regeneratorRuntime.wrap(function (_context) {
78
78
  while (1) switch (_context.prev = _context.next) {
79
79
  case 0:
80
80
  if (isMediaRepresentation(representation)) {
81
- _context.next = 2;
81
+ _context.next = 1;
82
82
  break;
83
83
  }
84
84
  return _context.abrupt("return", {
85
85
  representation: representation,
86
86
  altRepresentation: altRepresentation
87
87
  });
88
- case 2:
89
- _context.prev = 2;
90
- _context.next = 5;
88
+ case 1:
89
+ _context.prev = 1;
90
+ _context.next = 2;
91
91
  return this.tokenManager.getToken('read');
92
- case 5:
92
+ case 2:
93
93
  readToken = _context.sent;
94
94
  return _context.abrupt("return", Object.entries({
95
95
  representation: representation,
@@ -116,18 +116,18 @@ var SiteEmojiResource = /*#__PURE__*/function () {
116
116
  representation: representation,
117
117
  altRepresentation: altRepresentation
118
118
  }));
119
- case 9:
120
- _context.prev = 9;
121
- _context.t0 = _context["catch"](2);
119
+ case 3:
120
+ _context.prev = 3;
121
+ _t = _context["catch"](1);
122
122
  return _context.abrupt("return", {
123
123
  representation: representation,
124
124
  altRepresentation: altRepresentation
125
125
  });
126
- case 12:
126
+ case 4:
127
127
  case "end":
128
128
  return _context.stop();
129
129
  }
130
- }, _callee, this, [[2, 9]]);
130
+ }, _callee, this, [[1, 3]]);
131
131
  }));
132
132
  function generateTokenisedMediaURLS(_x, _x2) {
133
133
  return _generateTokenisedMediaURLS.apply(this, arguments);
@@ -300,28 +300,29 @@ var EmojiUploadPicker = function EmojiUploadPicker(props) {
300
300
  var onFileLoad = useCallback(function (file) {
301
301
  return /*#__PURE__*/function () {
302
302
  var _ref = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee(f) {
303
- return _regeneratorRuntime.wrap(function _callee$(_context) {
303
+ var _t;
304
+ return _regeneratorRuntime.wrap(function (_context) {
304
305
  while (1) switch (_context.prev = _context.next) {
305
306
  case 0:
306
307
  _context.prev = 0;
307
308
  setFilename(file.name);
308
- _context.next = 4;
309
+ _context.next = 1;
309
310
  return ImageUtil.parseImage(f.target.result);
310
- case 4:
311
+ case 1:
311
312
  setPreviewImage(f.target.result);
312
313
  setChooseEmojiErrorMessage(undefined);
313
- _context.next = 12;
314
+ _context.next = 3;
314
315
  break;
315
- case 8:
316
- _context.prev = 8;
317
- _context.t0 = _context["catch"](0);
316
+ case 2:
317
+ _context.prev = 2;
318
+ _t = _context["catch"](0);
318
319
  setChooseEmojiErrorMessage( /*#__PURE__*/React.createElement(FormattedMessage, messages.emojiInvalidImage));
319
320
  cancelChooseFile();
320
- case 12:
321
+ case 3:
321
322
  case "end":
322
323
  return _context.stop();
323
324
  }
324
- }, _callee, null, [[0, 8]]);
325
+ }, _callee, null, [[0, 2]]);
325
326
  }));
326
327
  return function (_x) {
327
328
  return _ref.apply(this, arguments);
@@ -65,7 +65,7 @@ export var ResourcedEmojiComponent = function ResourcedEmojiComponent(_ref) {
65
65
  reason,
66
66
  foundEmoji,
67
67
  _args = arguments;
68
- return _regeneratorRuntime.wrap(function _callee$(_context) {
68
+ return _regeneratorRuntime.wrap(function (_context) {
69
69
  while (1) switch (_context.prev = _context.next) {
70
70
  case 0:
71
71
  optimisticFetch = _args.length > 2 && _args[2] !== undefined ? _args[2] : false;
@@ -131,7 +131,7 @@ export var ResourcedEmojiComponent = function ResourcedEmojiComponent(_ref) {
131
131
  setLoaded(true);
132
132
  sampledUfoRenderedEmoji(emojiId).mark(UfoEmojiTimings.METADATA_END);
133
133
  }
134
- case 5:
134
+ case 1:
135
135
  case "end":
136
136
  return _context.stop();
137
137
  }
@@ -465,7 +465,7 @@ var EmojiPickerComponent = function EmojiPickerComponent(_ref) {
465
465
  var onUploadEmoji = useCallback( /*#__PURE__*/function () {
466
466
  var _ref3 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee(upload, retry) {
467
467
  var errorSetter, onSuccess, uploadShortName, existing;
468
- return _regeneratorRuntime.wrap(function _callee$(_context) {
468
+ return _regeneratorRuntime.wrap(function (_context) {
469
469
  while (1) switch (_context.prev = _context.next) {
470
470
  case 0:
471
471
  fireAnalytics(uploadConfirmButton({
@@ -483,23 +483,23 @@ var EmojiPickerComponent = function EmojiPickerComponent(_ref) {
483
483
  scrollToUploadedEmoji(emojiDescription);
484
484
  };
485
485
  if (!fg('platform_emoji_picker_refresh')) {
486
- _context.next = 11;
486
+ _context.next = 2;
487
487
  break;
488
488
  }
489
489
  uploadShortName = ":".concat(upload.name.toLowerCase(), ":");
490
- _context.next = 7;
490
+ _context.next = 1;
491
491
  return emojiProvider.findByShortName(uploadShortName);
492
- case 7:
492
+ case 1:
493
493
  existing = _context.sent;
494
494
  if (!existing) {
495
- _context.next = 11;
495
+ _context.next = 2;
496
496
  break;
497
497
  }
498
498
  errorSetter(messages.emojiDuplicateName);
499
499
  return _context.abrupt("return");
500
- case 11:
500
+ case 2:
501
501
  uploadEmoji(upload, emojiProvider, errorSetter, onSuccess, fireAnalytics, retry);
502
- case 12:
502
+ case 3:
503
503
  case "end":
504
504
  return _context.stop();
505
505
  }
@@ -42,8 +42,8 @@ var EmojiUploadComponent = function EmojiUploadComponent(props) {
42
42
  }, []);
43
43
  var onUploadEmoji = /*#__PURE__*/function () {
44
44
  var _ref = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee(upload, retry, onSuccessHandler) {
45
- var errorSetter, message;
46
- return _regeneratorRuntime.wrap(function _callee$(_context) {
45
+ var errorSetter, message, _t;
46
+ return _regeneratorRuntime.wrap(function (_context) {
47
47
  while (1) switch (_context.prev = _context.next) {
48
48
  case 0:
49
49
  ufoExperiences['emoji-uploaded'].start();
@@ -51,27 +51,27 @@ var EmojiUploadComponent = function EmojiUploadComponent(props) {
51
51
  retry: retry
52
52
  });
53
53
  if (!supportsUploadFeature(emojiProvider)) {
54
- _context.next = 16;
54
+ _context.next = 4;
55
55
  break;
56
56
  }
57
57
  fireAnalytics(uploadConfirmButton({
58
58
  retry: retry
59
59
  }));
60
- _context.prev = 4;
61
- _context.next = 7;
60
+ _context.prev = 1;
61
+ _context.next = 2;
62
62
  return emojiProvider.prepareForUpload();
63
- case 7:
63
+ case 2:
64
64
  errorSetter = function errorSetter(message) {
65
65
  setUploadErrorMessage(message);
66
66
  }; // internally handled error from upload callback
67
67
  uploadEmoji(upload, emojiProvider, errorSetter, onUploaded(onSuccessHandler), fireAnalytics, retry);
68
- _context.next = 16;
68
+ _context.next = 4;
69
69
  break;
70
- case 11:
71
- _context.prev = 11;
72
- _context.t0 = _context["catch"](4);
70
+ case 3:
71
+ _context.prev = 3;
72
+ _t = _context["catch"](1);
73
73
  // error from upload token generation
74
- message = _context.t0 instanceof Error ? _context.t0.message : 'Issue with generating upload token';
74
+ message = _t instanceof Error ? _t.message : 'Issue with generating upload token';
75
75
  ufoExperiences['emoji-uploaded'].failure({
76
76
  metadata: {
77
77
  source: 'EmojiUploadComponent',
@@ -79,11 +79,11 @@ var EmojiUploadComponent = function EmojiUploadComponent(props) {
79
79
  }
80
80
  });
81
81
  setUploadErrorMessage(messages.emojiUploadFailed);
82
- case 16:
82
+ case 4:
83
83
  case "end":
84
84
  return _context.stop();
85
85
  }
86
- }, _callee, null, [[4, 11]]);
86
+ }, _callee, null, [[1, 3]]);
87
87
  }));
88
88
  return function onUploadEmoji(_x, _x2, _x3) {
89
89
  return _ref.apply(this, arguments);