From a58638a6698538f2b7c793b5049a9635a5b03624 Mon Sep 17 00:00:00 2001 From: cel 🌸 Date: Mon, 24 Mar 2025 10:42:41 +0000 Subject: fix: chat list item message preview one line only --- src/main.rs | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/main.rs b/src/main.rs index 08dd833..492a387 100644 --- a/src/main.rs +++ b/src/main.rs @@ -988,6 +988,7 @@ fn chat_list_item<'a>( ) -> Element<'a, Message> { let mut content: Column = column![text(chat.correspondent.to_string())]; if let Some(latest_message) = latest_message { + let message = latest_message.body.body.replace("\n", " "); let date = latest_message.timestamp.naive_local(); let now = Local::now().naive_local(); let timeinfo; @@ -999,7 +1000,7 @@ fn chat_list_item<'a>( } content = content.push( row![ - container(text(latest_message.body.body.clone()).wrapping(Wrapping::None)) + container(text(message).wrapping(Wrapping::None)) .clip(true) .width(Fill), timeinfo -- cgit