fix
This commit is contained in:
@@ -318,7 +318,7 @@ class _NotificationsScreenState extends ConsumerState<NotificationsScreen> {
|
||||
),
|
||||
const SizedBox(height: 2),
|
||||
Text(
|
||||
notification.description,
|
||||
_formatDescription(notification.description),
|
||||
style: TextStyle(
|
||||
fontFamily: 'SourceSerif4',
|
||||
fontSize: 14,
|
||||
@@ -425,6 +425,18 @@ class _NotificationsScreenState extends ConsumerState<NotificationsScreen> {
|
||||
}
|
||||
}
|
||||
|
||||
String _formatDescription(String description) {
|
||||
final trimmed = description.trim();
|
||||
// Detect raw URLs (image/gif links) and show friendly text instead
|
||||
if (trimmed.startsWith('http://') || trimmed.startsWith('https://')) {
|
||||
final lower = trimmed.toLowerCase();
|
||||
if (lower.contains('.gif')) return 'Sent a GIF';
|
||||
if (lower.contains('.png') || lower.contains('.jpg') || lower.contains('.jpeg') || lower.contains('.webp')) return 'Sent an image';
|
||||
return 'Sent a link';
|
||||
}
|
||||
return description;
|
||||
}
|
||||
|
||||
String _timeAgo(DateTime dateTime) {
|
||||
final now = DateTime.now();
|
||||
final diff = now.difference(dateTime);
|
||||
|
||||
Reference in New Issue
Block a user