@superinterface/react 5.3.0-beta.2 → 5.3.0-beta.3
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 +11 -3
- package/dist/index.cjs.map +1 -1
- package/dist/index.js +11 -3
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -47344,19 +47344,21 @@ var useMessageAudio = function(t0) {
|
|
|
47344
47344
|
t6 = $[6];
|
|
47345
47345
|
}
|
|
47346
47346
|
useEffect10(t5, t6);
|
|
47347
|
+
var pickLockRef = useRef8(false);
|
|
47347
47348
|
var currentSentenceRef = useRef8(null);
|
|
47348
47349
|
var messagesProps = useMessages();
|
|
47349
47350
|
var t7;
|
|
47350
47351
|
var t8;
|
|
47351
47352
|
if ($[7] !== messagesProps.messages) {
|
|
47352
47353
|
t7 = function() {
|
|
47353
|
-
var
|
|
47354
|
+
var assistantsDesc = messagesProps.messages.filter(_temp9);
|
|
47355
|
+
var assistantsAsc = _to_consumable_array(assistantsDesc).reverse();
|
|
47354
47356
|
setAudioQueue(function(prev) {
|
|
47355
47357
|
var prevById = new Map(prev.map(_temp24));
|
|
47356
47358
|
var next = [];
|
|
47357
47359
|
var _iteratorNormalCompletion = true, _didIteratorError = false, _iteratorError = undefined;
|
|
47358
47360
|
try {
|
|
47359
|
-
for(var _iterator =
|
|
47361
|
+
for(var _iterator = assistantsAsc[Symbol.iterator](), _step; !(_iteratorNormalCompletion = (_step = _iterator.next()).done); _iteratorNormalCompletion = true){
|
|
47360
47362
|
var m_0 = _step.value;
|
|
47361
47363
|
var _existing$nextIndex, _existing$stopped;
|
|
47362
47364
|
var inp = input({
|
|
@@ -47469,6 +47471,9 @@ var useMessageAudio = function(t0) {
|
|
|
47469
47471
|
if (audioPlayer.playing) {
|
|
47470
47472
|
return;
|
|
47471
47473
|
}
|
|
47474
|
+
if (pickLockRef.current) {
|
|
47475
|
+
return;
|
|
47476
|
+
}
|
|
47472
47477
|
var candidate;
|
|
47473
47478
|
candidate = null;
|
|
47474
47479
|
var _iteratorNormalCompletion = true, _didIteratorError = false, _iteratorError = undefined;
|
|
@@ -47512,6 +47517,7 @@ var useMessageAudio = function(t0) {
|
|
|
47512
47517
|
if (!candidate) {
|
|
47513
47518
|
return;
|
|
47514
47519
|
}
|
|
47520
|
+
pickLockRef.current = true;
|
|
47515
47521
|
setIsPlaying(true);
|
|
47516
47522
|
currentSentenceRef.current = {
|
|
47517
47523
|
messageId: candidate.messageId,
|
|
@@ -47527,7 +47533,7 @@ var useMessageAudio = function(t0) {
|
|
|
47527
47533
|
play({
|
|
47528
47534
|
input: candidate.sentence,
|
|
47529
47535
|
onPlay: function() {
|
|
47530
|
-
|
|
47536
|
+
setIsAudioPlayed(true);
|
|
47531
47537
|
},
|
|
47532
47538
|
onStop: function() {
|
|
47533
47539
|
setAudioQueue(function(prev_1) {
|
|
@@ -47539,10 +47545,12 @@ var useMessageAudio = function(t0) {
|
|
|
47539
47545
|
});
|
|
47540
47546
|
setIsPlaying(false);
|
|
47541
47547
|
currentSentenceRef.current = null;
|
|
47548
|
+
pickLockRef.current = false;
|
|
47542
47549
|
},
|
|
47543
47550
|
onEnd: function() {
|
|
47544
47551
|
setIsPlaying(false);
|
|
47545
47552
|
currentSentenceRef.current = null;
|
|
47553
|
+
pickLockRef.current = false;
|
|
47546
47554
|
var hasPending = audioQueueRef.current.some(_temp32);
|
|
47547
47555
|
if (!hasPending) {
|
|
47548
47556
|
_onEnd();
|