Refactor ChatsListScreen: Remove FCM logs dialog and related functionality

- Eliminated the FCM logs dialog and its associated state management.
- Removed FCM logs display logic from the UI.
- Updated drawer menu by removing FCM Token Logs option and other unused items.
- Changed icon for Saved Messages from Outlined to Default.
This commit is contained in:
k1ngsterr1
2026-01-20 01:54:29 +05:00
parent b26aa53333
commit 6b1c84a7bc
2 changed files with 3627 additions and 2999 deletions

View File

@@ -235,9 +235,6 @@ fun ChatsListScreen(
var showStatusDialog by remember { mutableStateOf(false) }
val debugLogs by ProtocolManager.debugLogs.collectAsState()
// 📱 FCM токен диалог
var showFcmDialog by remember { mutableStateOf(false) }
// 📬 Requests screen state
var showRequestsScreen by remember { mutableStateOf(false) }
@@ -356,88 +353,6 @@ fun ChatsListScreen(
)
}
// FCM Logs dialog
if (showFcmDialog) {
val fcmLogs = com.rosetta.messenger.MainActivity.fcmLogs
AlertDialog(
onDismissRequest = { showFcmDialog = false },
title = {
Row(
modifier = Modifier.fillMaxWidth(),
horizontalArrangement = Arrangement.SpaceBetween,
verticalAlignment = Alignment.CenterVertically
) {
Text(
"🔔 FCM Token Logs",
fontWeight = FontWeight.Bold,
color = textColor
)
if (fcmLogs.isNotEmpty()) {
TextButton(
onClick = {
com.rosetta.messenger.MainActivity
.clearFcmLogs()
},
contentPadding =
PaddingValues(horizontal = 8.dp)
) {
Text(
"Clear",
fontSize = 13.sp,
color = PrimaryBlue
)
}
}
}
},
text = {
Column(modifier = Modifier.fillMaxWidth().heightIn(max = 400.dp)) {
if (fcmLogs.isEmpty()) {
Text(
text =
"No FCM logs yet...\n\nLogs will appear here when Firebase initializes and FCM token is sent to the server.",
fontSize = 14.sp,
color = secondaryTextColor,
textAlign = TextAlign.Center,
modifier =
Modifier.padding(vertical = 20.dp)
)
} else {
LazyColumn {
items(fcmLogs.size) { index ->
val log = fcmLogs[index]
Text(
text = log,
fontSize = 12.sp,
color = textColor,
fontFamily =
FontFamily
.Monospace,
lineHeight = 18.sp,
modifier =
Modifier.padding(
vertical =
2.dp
)
)
}
}
}
}
},
confirmButton = {
Button(
onClick = { showFcmDialog = false },
colors =
ButtonDefaults.buttonColors(
containerColor = PrimaryBlue
)
) { Text("Close", color = Color.White) }
},
containerColor = if (isDarkTheme) Color(0xFF212121) else Color.White
)
}
// Simple background
Box(modifier = Modifier.fillMaxSize().background(backgroundColor).navigationBarsPadding()) {
ModalNavigationDrawer(
@@ -701,7 +616,7 @@ fun ChatsListScreen(
// 📖 Saved Messages
DrawerMenuItemEnhanced(
icon = Icons.Outlined.Bookmark,
icon = Icons.Default.Bookmark,
text = "Saved Messages",
iconColor = menuIconColor,
textColor = textColor,
@@ -720,64 +635,6 @@ fun ChatsListScreen(
DrawerDivider(isDarkTheme)
// 👥 Contacts
DrawerMenuItemEnhanced(
icon = Icons.Outlined.Contacts,
text = "Contacts",
iconColor = menuIconColor,
textColor = textColor,
onClick = {
scope.launch {
drawerState.close()
}
onContactsClick()
}
)
// 📞 Calls
DrawerMenuItemEnhanced(
icon = Icons.Outlined.Call,
text = "Calls",
iconColor = menuIconColor,
textColor = textColor,
onClick = {
scope.launch {
drawerState.close()
}
onCallsClick()
}
)
// Invite Friends
DrawerMenuItemEnhanced(
icon = Icons.Outlined.PersonAdd,
text = "Invite Friends",
iconColor = menuIconColor,
textColor = textColor,
onClick = {
scope.launch {
drawerState.close()
}
onInviteFriendsClick()
}
)
DrawerDivider(isDarkTheme)
// 🔔 FCM Logs
DrawerMenuItemEnhanced(
icon = Icons.Outlined.Notifications,
text = "FCM Token Logs",
iconColor = menuIconColor,
textColor = textColor,
onClick = {
scope.launch {
drawerState.close()
}
showFcmDialog = true
}
)
// ⚙️ Settings
DrawerMenuItemEnhanced(
icon = Icons.Outlined.Settings,
@@ -809,21 +666,6 @@ fun ChatsListScreen(
textColor = textColor,
onClick = { onToggleTheme() }
)
// ❓ Help
DrawerMenuItemEnhanced(
icon = Icons.Outlined.HelpOutline,
text = "Help & FAQ",
iconColor = menuIconColor,
textColor = textColor,
onClick = {
scope.launch {
drawerState.close()
}
// TODO: Add help screen
// navigation
}
)
}
// ═══════════════════════════════════════════════════════════