@superinterface/react 5.3.0-beta.13 → 5.3.0-beta.14

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/dist/index.cjs CHANGED
@@ -48146,95 +48146,64 @@ var useMessageAudio = function(_ref) {
48146
48146
  }) : m_14;
48147
48147
  });
48148
48148
  });
48149
- var runPlayback = /* @__PURE__ */ function() {
48150
- var _ref0 = _asyncToGenerator11(function() {
48151
- var nextIndex_0, error;
48152
- return _ts_generator(this, function(_state) {
48153
- switch(_state.label){
48154
- case 0:
48155
- nextIndex_0 = candidate.startIndex;
48156
- _state.label = 1;
48157
- case 1:
48158
- _state.trys.push([
48159
- 1,
48160
- 3,
48161
- 4,
48162
- 5
48163
- ]);
48164
- return [
48165
- 4,
48166
- playSegmentsImpl({
48167
- segments: candidate.segments,
48168
- startIndex: candidate.startIndex,
48169
- message: candidate.message,
48170
- play: function() {
48171
- var _play = _asyncToGenerator11(function(segment_0) {
48172
- return _ts_generator(this, function(_state) {
48173
- switch(_state.label){
48174
- case 0:
48175
- activeSegmentsRef.current += 1;
48176
- nextIndex_0 += 1;
48177
- currentSegmentRef.current = {
48178
- messageId: candidate.messageId,
48179
- nextIndex: nextIndex_0
48180
- };
48181
- return [
48182
- 4,
48183
- playInternal(segment_0, {
48184
- onPlay: function() {},
48185
- onStop: function() {
48186
- return handleStop(candidate.messageId);
48187
- },
48188
- onEnd: function() {
48189
- return handleSegmentEnd();
48190
- }
48191
- })
48192
- ];
48193
- case 1:
48194
- _state.sent();
48195
- return [
48196
- 2
48197
- ];
48149
+ var runPlayback = function() {
48150
+ var nextIndex_0 = candidate.startIndex;
48151
+ var launch = function() {
48152
+ return playSegmentsImpl({
48153
+ segments: candidate.segments,
48154
+ startIndex: candidate.startIndex,
48155
+ message: candidate.message,
48156
+ play: function() {
48157
+ var _play = _asyncToGenerator11(function(segment_0) {
48158
+ return _ts_generator(this, function(_state) {
48159
+ switch(_state.label){
48160
+ case 0:
48161
+ activeSegmentsRef.current += 1;
48162
+ nextIndex_0 += 1;
48163
+ currentSegmentRef.current = {
48164
+ messageId: candidate.messageId,
48165
+ nextIndex: nextIndex_0
48166
+ };
48167
+ return [
48168
+ 4,
48169
+ playInternal(segment_0, {
48170
+ onPlay: function() {},
48171
+ onStop: function() {
48172
+ return handleStop(candidate.messageId);
48173
+ },
48174
+ onEnd: function() {
48175
+ return handleSegmentEnd();
48198
48176
  }
48199
- });
48200
- });
48201
- function play(_x6) {
48202
- return _play.apply(this, arguments);
48203
- }
48204
- return play;
48205
- }()
48206
- })
48207
- ];
48208
- case 2:
48209
- _state.sent();
48210
- return [
48211
- 3,
48212
- 5
48213
- ];
48214
- case 3:
48215
- error = _state.sent();
48216
- handleStop(candidate.messageId);
48217
- console.error(error);
48218
- return [
48219
- 3,
48220
- 5
48221
- ];
48222
- case 4:
48223
- checkForCompletion();
48224
- return [
48225
- 7
48226
- ];
48227
- case 5:
48228
- return [
48229
- 2
48230
- ];
48231
- }
48177
+ })
48178
+ ];
48179
+ case 1:
48180
+ _state.sent();
48181
+ return [
48182
+ 2
48183
+ ];
48184
+ }
48185
+ });
48186
+ });
48187
+ function play(_x6) {
48188
+ return _play.apply(this, arguments);
48189
+ }
48190
+ return play;
48191
+ }()
48232
48192
  });
48233
- });
48234
- return function runPlayback2() {
48235
- return _ref0.apply(this, arguments);
48236
48193
  };
48237
- }();
48194
+ try {
48195
+ Promise.resolve(launch()).catch(function(error_0) {
48196
+ handleStop(candidate.messageId);
48197
+ console.error(error_0);
48198
+ }).finally(function() {
48199
+ checkForCompletion();
48200
+ });
48201
+ } catch (error) {
48202
+ handleStop(candidate.messageId);
48203
+ console.error(error);
48204
+ checkForCompletion();
48205
+ }
48206
+ };
48238
48207
  runPlayback();
48239
48208
  }, [
48240
48209
  audioQueue,