File tree 1 file changed +5
-1
lines changed
1 file changed +5
-1
lines changed Original file line number Diff line number Diff line change @@ -293,7 +293,9 @@ const actions = {
293
293
*/
294
294
async [ PNP_SERVICE_CONNECT ] ( { state, commit, dispatch } ) {
295
295
// if connection to pnp service already open, then nothing to do
296
- if ( peer && peer . open ) return
296
+ if ( peer && peer . open ) { return }
297
+ // if in the middle of pnp server connection cycle, skip
298
+ if ( state . pnpServiceConnectionStatus === PNP_SERVICE_CONNECTING ) { return }
297
299
// Create own peer object with connection to shared PeerJS server
298
300
console . log ( 'pnp client: creating peer' )
299
301
// If we already have an assigned peerId, we will reuse it forever.
@@ -320,6 +322,8 @@ const actions = {
320
322
async [ PNP_SERVICE_RECONNECT ] ( { state, commit, dispatch } ) {
321
323
// if connection to pnp service already open, then nothing to do
322
324
if ( peer . open ) return
325
+ // if in the middle of pnp server connection cycle, skip
326
+ if ( state . pnpServiceConnectionStatus === PNP_SERVICE_CONNECTING ) { return }
323
327
console . log ( 'pnp client: reconnecting peer...' )
324
328
// Workaround for peer.reconnect deleting previous id
325
329
if ( ! peer . id ) {
You can’t perform that action at this time.
0 commit comments