refactor: Remove FCM token dialog and related UI elements; streamline chat screen layout
This commit is contained in:
@@ -281,88 +281,6 @@ fun ChatsListScreen(
|
||||
containerColor = if (isDarkTheme) Color(0xFF212121) else Color.White
|
||||
)
|
||||
}
|
||||
|
||||
// 🔔 FCM Token Dialog
|
||||
if (showFcmDialog) {
|
||||
val prefs = context.getSharedPreferences("rosetta_prefs", Context.MODE_PRIVATE)
|
||||
val fcmToken = prefs.getString("fcm_token", "No token found") ?: "No token found"
|
||||
val clipboardManager = androidx.compose.ui.platform.LocalClipboardManager.current
|
||||
|
||||
AlertDialog(
|
||||
onDismissRequest = { showFcmDialog = false },
|
||||
title = {
|
||||
Text(
|
||||
"FCM Push Token",
|
||||
fontWeight = FontWeight.Bold,
|
||||
color = textColor
|
||||
)
|
||||
},
|
||||
text = {
|
||||
Column(
|
||||
modifier = Modifier
|
||||
.fillMaxWidth()
|
||||
.verticalScroll(rememberScrollState())
|
||||
) {
|
||||
Text(
|
||||
"Token:",
|
||||
fontSize = 12.sp,
|
||||
fontWeight = FontWeight.Bold,
|
||||
color = secondaryTextColor
|
||||
)
|
||||
Spacer(modifier = Modifier.height(4.dp))
|
||||
Text(
|
||||
fcmToken,
|
||||
fontSize = 11.sp,
|
||||
fontFamily = FontFamily.Monospace,
|
||||
color = textColor,
|
||||
modifier = Modifier
|
||||
.fillMaxWidth()
|
||||
.clip(RoundedCornerShape(8.dp))
|
||||
.background(if (isDarkTheme) Color(0xFF2A2A2A) else Color(0xFFF5F5F5))
|
||||
.padding(8.dp)
|
||||
.clickable {
|
||||
clipboardManager.setText(androidx.compose.ui.text.AnnotatedString(fcmToken))
|
||||
android.widget.Toast.makeText(context, "Token copied!", android.widget.Toast.LENGTH_SHORT).show()
|
||||
}
|
||||
)
|
||||
|
||||
Spacer(modifier = Modifier.height(16.dp))
|
||||
|
||||
Text(
|
||||
"Status:",
|
||||
fontSize = 12.sp,
|
||||
fontWeight = FontWeight.Bold,
|
||||
color = secondaryTextColor
|
||||
)
|
||||
Spacer(modifier = Modifier.height(4.dp))
|
||||
Text(
|
||||
if (fcmToken != "No token found") "✅ Token received" else "❌ Token not received",
|
||||
fontSize = 14.sp,
|
||||
color = if (fcmToken != "No token found") Color(0xFF4CAF50) else Color(0xFFF44336)
|
||||
)
|
||||
|
||||
Spacer(modifier = Modifier.height(8.dp))
|
||||
|
||||
Text(
|
||||
"📤 Token is sent to server after login (packet ID: 0x10)",
|
||||
fontSize = 12.sp,
|
||||
color = secondaryTextColor
|
||||
)
|
||||
}
|
||||
},
|
||||
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)) {
|
||||
@@ -735,15 +653,6 @@ fun ChatsListScreen(
|
||||
actions = {
|
||||
// Search only on main screen
|
||||
if (!showRequestsScreen) {
|
||||
// 🔔 FCM Debug button
|
||||
IconButton(onClick = { showFcmDialog = true }) {
|
||||
Icon(
|
||||
Icons.Default.Info,
|
||||
contentDescription = "FCM Token",
|
||||
tint = textColor
|
||||
)
|
||||
}
|
||||
|
||||
IconButton(
|
||||
onClick = {
|
||||
if (protocolState == ProtocolState.AUTHENTICATED) {
|
||||
|
||||
Reference in New Issue
Block a user