From 852dd054625678114e36937eb5e180c04673017f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?K=C3=A9vin=20Commaille?= Date: Sat, 20 Aug 2022 19:02:28 +0200 Subject: [PATCH] room-history: Dont overwrite message row parent's CSS classes --- src/session/content/room_history/message_row/mod.rs | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/session/content/room_history/message_row/mod.rs b/src/session/content/room_history/message_row/mod.rs index 23c2e8c6..dd132622 100644 --- a/src/session/content/room_history/message_row/mod.rs +++ b/src/session/content/room_history/message_row/mod.rs @@ -138,9 +138,9 @@ impl MessageRow { priv_.header.set_visible(visible); if let Some(list_item) = self.parent().and_then(|w| w.parent()) { - if visible { - list_item.set_css_classes(&["has-header"]); - } else { + if visible && !list_item.has_css_class("has-header") { + list_item.add_css_class("has-header"); + } else if !visible && list_item.has_css_class("has-header") { list_item.remove_css_class("has-header"); } }