refactor: remove excessive logging and improve code clarity in various components

This commit is contained in:
k1ngsterr1
2026-02-05 03:45:24 +05:00
parent a3549e1793
commit f5a8070aa9
8 changed files with 42 additions and 62 deletions

View File

@@ -107,24 +107,16 @@ class MessageRepository private constructor(private val context: Context) {
*/
fun initialize(publicKey: String, privateKey: String) {
val start = System.currentTimeMillis()
android.util.Log.d("MessageRepository", "🔧 initialize started for ${publicKey.take(8)}...")
// 🔥 Очищаем кэш запрошенных user info при смене аккаунта
// 🔥 Очищаем кэш запрошенных user info при смене аккаунта
if (currentAccount != publicKey) {
requestedUserInfoKeys.clear()
android.util.Log.d("MessageRepository", "🔧 Cleared user info cache (account changed)")
}
}
currentAccount = publicKey
currentPrivateKey = privateKey
android.util.Log.d("MessageRepository", "🔧 initialize completed in ${System.currentTimeMillis() - start}ms (launching dialogs flow in background)")
// Загрузка диалогов
// Загрузка диалогов
scope.launch {
android.util.Log.d("MessageRepository", "📂 Starting dialogs flow collection...")
dialogDao.getDialogsFlow(publicKey).collect { entities ->
android.util.Log.d("MessageRepository", "📂 Got ${entities.size} dialogs from DB")
_dialogs.value = entities.map { it.toDialog() }
// 🔥 Запрашиваем информацию о пользователях, у которых нет имени