feat: Fix WebSocket connection issues after account registration by ensuring connection before authentication
This commit is contained in:
@@ -175,7 +175,13 @@ class AuthStateManager(
|
||||
|
||||
loadAccounts()
|
||||
|
||||
// Step 8: Authenticate with protocol
|
||||
// Step 8: Connect and authenticate with protocol
|
||||
Log.d(TAG, "🌐 Connecting to protocol server...")
|
||||
ProtocolManager.connect()
|
||||
|
||||
// Give WebSocket time to connect before authenticating
|
||||
kotlinx.coroutines.delay(500)
|
||||
|
||||
Log.d(TAG, "🌐 Authenticating with protocol server...")
|
||||
ProtocolManager.authenticate(keyPair.publicKey, privateKeyHash)
|
||||
|
||||
@@ -236,7 +242,13 @@ class AuthStateManager(
|
||||
status = AuthStatus.Authenticated(decryptedAccount)
|
||||
)}
|
||||
|
||||
// Authenticate with protocol
|
||||
// Connect and authenticate with protocol
|
||||
Log.d(TAG, "🌐 Connecting to protocol server...")
|
||||
ProtocolManager.connect()
|
||||
|
||||
// Give WebSocket time to connect before authenticating
|
||||
kotlinx.coroutines.delay(500)
|
||||
|
||||
Log.d(TAG, "🌐 Authenticating with protocol server...")
|
||||
ProtocolManager.authenticate(decryptedAccount.publicKey, decryptedAccount.privateKeyHash)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user