File tree Expand file tree Collapse file tree 4 files changed +9
-3
lines changed Expand file tree Collapse file tree 4 files changed +9
-3
lines changed Original file line number Diff line number Diff line change 1
1
{
2
2
"name" : " @humeai/voice-embed-react" ,
3
- "version" : " 0.2.0-beta.16 " ,
3
+ "version" : " 0.2.0-beta.17 " ,
4
4
"description" : " " ,
5
5
"main" : " ./dist/index.js" ,
6
6
"module" : " ./dist/index.mjs" ,
Original file line number Diff line number Diff line change 1
1
{
2
2
"name" : " @humeai/voice-embed" ,
3
- "version" : " 0.2.0-beta.16 " ,
3
+ "version" : " 0.2.0-beta.17 " ,
4
4
"description" : " " ,
5
5
"main" : " ./dist/index.js" ,
6
6
"module" : " ./dist/index.mjs" ,
Original file line number Diff line number Diff line change 1
1
{
2
2
"name" : " @humeai/voice-react" ,
3
- "version" : " 0.2.0-beta.16 " ,
3
+ "version" : " 0.2.0-beta.17 " ,
4
4
"description" : " " ,
5
5
"main" : " ./dist/index.js" ,
6
6
"module" : " ./dist/index.mjs" ,
Original file line number Diff line number Diff line change @@ -618,6 +618,7 @@ export const VoiceProvider: FC<VoiceProviderProps> = ({
618
618
isConnectingRef . current = false ;
619
619
} ,
620
620
[
621
+ checkIsDisconnecting ,
621
622
checkShouldContinueConnecting ,
622
623
client ,
623
624
config ,
@@ -651,7 +652,12 @@ export const VoiceProvider: FC<VoiceProviderProps> = ({
651
652
652
653
// WEBSOCKET - shut this down before shutting down the audio player
653
654
if ( client . readyState !== VoiceReadyState . CLOSED ) {
655
+ // socket is open, so close it. resourceStatusRef will be set to 'disconnected'
656
+ // in the onClose callback of the websocket client.
654
657
client . disconnect ( ) ;
658
+ } else {
659
+ // socket is already closed, so ensure that the socket status is appropriately set
660
+ resourceStatusRef . current . socket = 'disconnected' ;
655
661
}
656
662
// resourceStatusRef.current.socket is not set to 'disconnected' here,
657
663
// but rather in the onClose callback of the client. This is because
You can’t perform that action at this time.
0 commit comments