diff --git a/src/components/connectOverlay/ConnectOverlay.tsx b/src/components/connectOverlay/ConnectOverlay.tsx index e79771d..22346e6 100644 --- a/src/components/connectOverlay/ConnectOverlay.tsx +++ b/src/components/connectOverlay/ConnectOverlay.tsx @@ -27,7 +27,7 @@ const BRIDGE_URL = import.meta.env.VITE_BRIDGE_URL || ''; const ConnectOverlay: React.FC = ({ slideAnimation, close, - onConnect, + // onConnect, }) => { const [networksExpanded, setNetworksExpanded] = useState(true); const [walletsExpanded, setWalletsExpanded] = useState(false); @@ -47,40 +47,40 @@ const ConnectOverlay: React.FC = ({ WebApp.openLink(response.data.universalLink); close(); - const startTime = Date.now(); // Record start time - const timeout = 30000; // 30 seconds timeout - - // Function to check connection status - const checkConnection = async () => { - if (Date.now() - startTime > timeout) { - return; - } - - try { - const statusResponse = await axios.get( - BRIDGE_URL + '/is-connected', - { - headers: { - 'Content-Type': 'application/json', - 'Access-Control-Allow-Origin': '*', - 'ngrok-skip-browser-warning': 'true', - }, - } - ); - if (statusResponse.data.connected) { - onConnect(); - } else { - console.log('Not Connected, checking again...'); - setTimeout(checkConnection, 1000); - } - } catch (error) { - console.error('Error checking connection:', error); - setTimeout(checkConnection, 1000); - } - }; - - // Start checking connection status - checkConnection(); + // const startTime = Date.now(); // Record start time + // const timeout = 30000; // 30 seconds timeout + + // // Function to check connection status + // const checkConnection = async () => { + // if (Date.now() - startTime > timeout) { + // return; + // } + + // try { + // const statusResponse = await axios.get( + // BRIDGE_URL + '/is-connected', + // { + // headers: { + // 'Content-Type': 'application/json', + // 'Access-Control-Allow-Origin': '*', + // 'ngrok-skip-browser-warning': 'true', + // }, + // } + // ); + // if (statusResponse.data.connected) { + // onConnect(); + // } else { + // console.log('Not Connected, checking again...'); + // setTimeout(checkConnection, 1000); + // } + // } catch (error) { + // console.error('Error checking connection:', error); + // setTimeout(checkConnection, 1000); + // } + // }; + + // // Start checking connection status + // checkConnection(); } catch (error) { console.error('Error during initial connection:', error); }