@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.cjs
CHANGED
|
@@ -47493,19 +47493,21 @@ var useMessageAudio = function(t0) {
|
|
|
47493
47493
|
t6 = $[6];
|
|
47494
47494
|
}
|
|
47495
47495
|
(0, import_react67.useEffect)(t5, t6);
|
|
47496
|
+
var pickLockRef = (0, import_react67.useRef)(false);
|
|
47496
47497
|
var currentSentenceRef = (0, import_react67.useRef)(null);
|
|
47497
47498
|
var messagesProps = useMessages();
|
|
47498
47499
|
var t7;
|
|
47499
47500
|
var t8;
|
|
47500
47501
|
if ($[7] !== messagesProps.messages) {
|
|
47501
47502
|
t7 = function() {
|
|
47502
|
-
var
|
|
47503
|
+
var assistantsDesc = messagesProps.messages.filter(_temp9);
|
|
47504
|
+
var assistantsAsc = _to_consumable_array(assistantsDesc).reverse();
|
|
47503
47505
|
setAudioQueue(function(prev) {
|
|
47504
47506
|
var prevById = new Map(prev.map(_temp24));
|
|
47505
47507
|
var next = [];
|
|
47506
47508
|
var _iteratorNormalCompletion = true, _didIteratorError = false, _iteratorError = undefined;
|
|
47507
47509
|
try {
|
|
47508
|
-
for(var _iterator =
|
|
47510
|
+
for(var _iterator = assistantsAsc[Symbol.iterator](), _step; !(_iteratorNormalCompletion = (_step = _iterator.next()).done); _iteratorNormalCompletion = true){
|
|
47509
47511
|
var m_0 = _step.value;
|
|
47510
47512
|
var _existing$nextIndex, _existing$stopped;
|
|
47511
47513
|
var inp = input({
|
|
@@ -47618,6 +47620,9 @@ var useMessageAudio = function(t0) {
|
|
|
47618
47620
|
if (audioPlayer.playing) {
|
|
47619
47621
|
return;
|
|
47620
47622
|
}
|
|
47623
|
+
if (pickLockRef.current) {
|
|
47624
|
+
return;
|
|
47625
|
+
}
|
|
47621
47626
|
var candidate;
|
|
47622
47627
|
candidate = null;
|
|
47623
47628
|
var _iteratorNormalCompletion = true, _didIteratorError = false, _iteratorError = undefined;
|
|
@@ -47661,6 +47666,7 @@ var useMessageAudio = function(t0) {
|
|
|
47661
47666
|
if (!candidate) {
|
|
47662
47667
|
return;
|
|
47663
47668
|
}
|
|
47669
|
+
pickLockRef.current = true;
|
|
47664
47670
|
setIsPlaying(true);
|
|
47665
47671
|
currentSentenceRef.current = {
|
|
47666
47672
|
messageId: candidate.messageId,
|
|
@@ -47676,7 +47682,7 @@ var useMessageAudio = function(t0) {
|
|
|
47676
47682
|
play({
|
|
47677
47683
|
input: candidate.sentence,
|
|
47678
47684
|
onPlay: function() {
|
|
47679
|
-
|
|
47685
|
+
setIsAudioPlayed(true);
|
|
47680
47686
|
},
|
|
47681
47687
|
onStop: function() {
|
|
47682
47688
|
setAudioQueue(function(prev_1) {
|
|
@@ -47688,10 +47694,12 @@ var useMessageAudio = function(t0) {
|
|
|
47688
47694
|
});
|
|
47689
47695
|
setIsPlaying(false);
|
|
47690
47696
|
currentSentenceRef.current = null;
|
|
47697
|
+
pickLockRef.current = false;
|
|
47691
47698
|
},
|
|
47692
47699
|
onEnd: function() {
|
|
47693
47700
|
setIsPlaying(false);
|
|
47694
47701
|
currentSentenceRef.current = null;
|
|
47702
|
+
pickLockRef.current = false;
|
|
47695
47703
|
var hasPending = audioQueueRef.current.some(_temp32);
|
|
47696
47704
|
if (!hasPending) {
|
|
47697
47705
|
_onEnd();
|