fix linebreaks in message.title in channel_list_item

This commit is contained in:
2024-06-18 17:36:41 +02:00
parent 59d28d3c49
commit 9542405512
3 changed files with 13 additions and 9 deletions

View File

@@ -76,7 +76,7 @@ class _ChannelListItemState extends State<ChannelListItem> {
children: [
Expanded(
child: Text(
lastMessage?.title ?? '...',
_preformatTitle(lastMessage),
style: TextStyle(color: Theme.of(context).textTheme.bodyLarge?.color?.withAlpha(160)),
),
),
@@ -89,4 +89,9 @@ class _ChannelListItemState extends State<ChannelListItem> {
),
);
}
String _preformatTitle(SCNMessage? message) {
if (message == null) return '...';
return message.title.replaceAll('\n', '').replaceAll('\r', '').replaceAll('\t', ' ');
}
}