aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLibravatar cel 🌸 <cel@bunny.garden>2025-03-24 10:42:41 +0000
committerLibravatar cel 🌸 <cel@bunny.garden>2025-03-24 10:42:41 +0000
commita58638a6698538f2b7c793b5049a9635a5b03624 (patch)
treef67f72e3955d150dc9086b0840ddd9a56845df17
parente5d9f9becd3c6a732cf42f51fc48ac01f6650df8 (diff)
downloadmacaw-a58638a6698538f2b7c793b5049a9635a5b03624.tar.gz
macaw-a58638a6698538f2b7c793b5049a9635a5b03624.tar.bz2
macaw-a58638a6698538f2b7c793b5049a9635a5b03624.zip
fix: chat list item message preview one line only
-rw-r--r--src/main.rs3
1 files changed, 2 insertions, 1 deletions
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<Message> = 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