From 838e99fd1577c52121e148efabcd624114a8b9ad Mon Sep 17 00:00:00 2001 From: cel 🌸 Date: Wed, 11 Jun 2025 02:54:27 +0100 Subject: fmt: everything --- src/components/chats_list.rs | 33 ++++++++++++++++++++++++--------- 1 file changed, 24 insertions(+), 9 deletions(-) (limited to 'src/components/chats_list.rs') diff --git a/src/components/chats_list.rs b/src/components/chats_list.rs index f958ebe..43ee53e 100644 --- a/src/components/chats_list.rs +++ b/src/components/chats_list.rs @@ -4,7 +4,14 @@ use jid::BareJID; use leptos::prelude::*; use tracing::debug; -use crate::{chat::{ArcMacawChat, MacawChat}, client::Client, components::{icon::IconComponent, new_chat::NewChatWidget, overlay::Overlay}, icon::Icon, message::{ArcMacawMessage, MacawMessage}, message_subscriptions::MessageSubscriptions}; +use crate::{ + chat::{ArcMacawChat, MacawChat}, + client::Client, + components::{icon::IconComponent, new_chat::NewChatWidget, overlay::Overlay}, + icon::Icon, + message::{ArcMacawMessage, MacawMessage}, + message_subscriptions::MessageSubscriptions, +}; mod chats_list_item; @@ -22,11 +29,13 @@ pub fn ChatsList() -> impl IntoView { Ok(c) => { let mut chats = IndexMap::new(); for ((chat, chat_user), (message, message_user)) in c { - chats.insert(chat.correspondent.clone(), ( + chats.insert( + chat.correspondent.clone(), + ( ArcMacawChat::got_chat_and_user(chat, chat_user).await, ArcMacawMessage::got_message_and_user(message, message_user).await, - - )); + ), + ); } set_chats.set(chats); } @@ -51,7 +60,10 @@ pub fn ChatsList() -> impl IntoView { if let Some((chat, _latest_message)) = chats.shift_remove(&to) { // TODO: check if new message is actually latest message debug!("chat existed"); - debug!("new message: {}", new_message.message.get().read().body.body); + debug!( + "new message: {}", + new_message.message.get().read().body.body + ); chats.insert_before(0, to, (chat.clone(), new_message)); debug!("done setting"); } else { @@ -79,15 +91,19 @@ pub fn ChatsList() -> impl IntoView { // TODO: update icon, tooltip on hover.

Chats

-
- +
+ {move || { if *open_new_chat.read() { view! { - }.into_any() + } + .into_any() } else { view! {}.into_any() } @@ -102,4 +118,3 @@ pub fn ChatsList() -> impl IntoView {
} } - -- cgit