feat: Remove debug logging from various components for cleaner code

This commit is contained in:
k1ngsterr1
2026-01-14 04:43:32 +05:00
parent 5f6cde3885
commit 42d2eb9e9c
8 changed files with 1 additions and 130 deletions

View File

@@ -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)

View File

@@ -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)