File tree Expand file tree Collapse file tree 1 file changed +26
-25
lines changed
Expand file tree Collapse file tree 1 file changed +26
-25
lines changed Original file line number Diff line number Diff line change @@ -656,19 +656,19 @@ export class WebSocketConnector {
656656 reject ( error ) ;
657657 } ;
658658
659- if ( retriable ) {
660- this . _inflightStore . insert ( {
661- reqId,
662- action,
663- id : callbackId ,
664- message,
665- resolve : safeResolve ,
666- reject : safeReject ,
667- } ) ;
668- }
659+ const registerAndSend = async ( ) => {
660+ if ( retriable ) {
661+ this . _inflightStore . insert ( {
662+ reqId,
663+ action,
664+ id : callbackId ,
665+ message,
666+ resolve : safeResolve ,
667+ reject : safeReject ,
668+ } ) ;
669+ }
669670
670- void WsEventCallback . instance ( )
671- . registerCallback (
671+ await WsEventCallback . instance ( ) . registerCallback (
672672 {
673673 action,
674674 req_id : reqId ,
@@ -678,20 +678,21 @@ export class WebSocketConnector {
678678 } ,
679679 safeResolve ,
680680 safeReject
681- )
682- . then ( ( ) => {
683- try {
684- this . send ( message ) ;
685- } catch ( err ) {
686- if ( retriable && this . isNetworkError ( err ) ) {
687- return ;
688- }
689- safeReject ( err ) ;
681+ ) ;
682+
683+ try {
684+ this . send ( message ) ;
685+ } catch ( err ) {
686+ if ( retriable && this . isNetworkError ( err ) ) {
687+ return ;
690688 }
691- } )
692- . catch ( ( error ) => {
693- safeReject ( error ) ;
694- } ) ;
689+ safeReject ( err ) ;
690+ }
691+ } ;
692+
693+ void registerAndSend ( ) . catch ( ( error ) => {
694+ safeReject ( error ) ;
695+ } ) ;
695696 } ) ;
696697 }
697698
You can’t perform that action at this time.
0 commit comments