feat: Remove debug logging from various components for cleaner code
This commit is contained in:
@@ -1,6 +1,5 @@
|
||||
package com.rosetta.messenger.ui.auth
|
||||
|
||||
import android.util.Log
|
||||
import androidx.compose.animation.*
|
||||
import androidx.compose.animation.core.*
|
||||
import androidx.compose.foundation.*
|
||||
@@ -497,7 +496,6 @@ fun SetPasswordScreen(
|
||||
|
||||
// 🔌 Connect to server and authenticate
|
||||
val privateKeyHash = CryptoManager.generatePrivateKeyHash(keyPair.privateKey)
|
||||
Log.d("SetPasswordScreen", "🔌 Connecting to server...")
|
||||
ProtocolManager.connect()
|
||||
// Give WebSocket time to connect before authenticating
|
||||
kotlinx.coroutines.delay(500)
|
||||
|
||||
@@ -1,6 +1,5 @@
|
||||
package com.rosetta.messenger.ui.auth
|
||||
|
||||
import android.util.Log
|
||||
import androidx.compose.animation.*
|
||||
import androidx.compose.animation.core.*
|
||||
import androidx.compose.foundation.*
|
||||
@@ -86,7 +85,6 @@ fun UnlockScreen(
|
||||
LaunchedEffect(Unit) {
|
||||
// ⚡ СИНХРОННОЕ чтение последнего аккаунта ДО загрузки списка
|
||||
val lastLoggedKey = accountManager.getLastLoggedPublicKey()
|
||||
Log.d("UnlockScreen", "🔍 Last logged account from SharedPrefs: ${lastLoggedKey?.take(16) ?: "none"}")
|
||||
|
||||
val allAccounts = accountManager.getAllAccounts()
|
||||
accounts = allAccounts.map { acc ->
|
||||
@@ -97,26 +95,20 @@ fun UnlockScreen(
|
||||
)
|
||||
}
|
||||
|
||||
Log.d("UnlockScreen", "📋 Available accounts: ${accounts.map { "${it.name}:${it.publicKey.take(8)}" }}")
|
||||
|
||||
// Find the target account - приоритет: selectedAccountId > lastLoggedKey > первый
|
||||
val targetAccount = when {
|
||||
!selectedAccountId.isNullOrEmpty() -> {
|
||||
Log.d("UnlockScreen", "✅ Using selectedAccountId: ${selectedAccountId.take(16)}")
|
||||
accounts.find { it.publicKey == selectedAccountId }
|
||||
}
|
||||
!lastLoggedKey.isNullOrEmpty() -> {
|
||||
Log.d("UnlockScreen", "✅ Using lastLoggedKey: ${lastLoggedKey.take(16)}")
|
||||
accounts.find { it.publicKey == lastLoggedKey }
|
||||
}
|
||||
else -> {
|
||||
Log.d("UnlockScreen", "⚠️ No preference, using first account")
|
||||
accounts.firstOrNull()
|
||||
}
|
||||
}
|
||||
|
||||
selectedAccount = targetAccount ?: accounts.firstOrNull()
|
||||
Log.d("UnlockScreen", "🎯 Final selected: ${selectedAccount?.name} (${selectedAccount?.publicKey?.take(16)})")
|
||||
}
|
||||
|
||||
// Filter accounts by search
|
||||
@@ -580,7 +572,6 @@ fun UnlockScreen(
|
||||
)
|
||||
|
||||
// Connect to server and authenticate
|
||||
Log.d("UnlockScreen", "Connecting to server...")
|
||||
ProtocolManager.connect()
|
||||
// Give WebSocket time to connect before authenticating
|
||||
kotlinx.coroutines.delay(500)
|
||||
|
||||
Reference in New Issue
Block a user