From 470e19d3fc40595023d3bc288389e8ae79582e9b Mon Sep 17 00:00:00 2001 From: SamuelScheit Date: Sun, 30 Apr 2023 12:33:07 +0200 Subject: [PATCH] auto connect socket --- src/Socket/socket.ts | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/src/Socket/socket.ts b/src/Socket/socket.ts index 60e6b92..ea980af 100644 --- a/src/Socket/socket.ts +++ b/src/Socket/socket.ts @@ -34,11 +34,8 @@ export const makeSocket = (config: SocketConfig) => { const ws = new MobileSocket(config) ws.setMaxListeners(0) - if(!config.mobile) { - // if not mobile -> auto connect - ws.connect() - } else if(config.auth.creds.registered) { - // if mobile and registered -> auto connect + // if not mobile or already registered -> auto connect + if(!config.mobile || config.auth.creds.registered) { ws.connect() }