summaryrefslogtreecommitdiffstats
path: root/src/components/roster_list
diff options
context:
space:
mode:
authorLibravatar cel 🌸 <cel@bunny.garden>2025-06-01 21:32:13 +0100
committerLibravatar cel 🌸 <cel@bunny.garden>2025-06-01 21:32:13 +0100
commit12d9e5955092b282a96add03ddfc148f01f3a3e8 (patch)
treebca74c6132c25c8493b8b209f20203c71b1daad6 /src/components/roster_list
parent33bb7130943b5f74b3b0f08c5e6d8f7c5e54d4c0 (diff)
downloadmacaw-web-12d9e5955092b282a96add03ddfc148f01f3a3e8.tar.gz
macaw-web-12d9e5955092b282a96add03ddfc148f01f3a3e8.tar.bz2
macaw-web-12d9e5955092b282a96add03ddfc148f01f3a3e8.zip
WIP: fix untracked stateleptos-fetch
Diffstat (limited to 'src/components/roster_list')
-rw-r--r--src/components/roster_list/roster_list_item.rs14
1 files changed, 6 insertions, 8 deletions
diff --git a/src/components/roster_list/roster_list_item.rs b/src/components/roster_list/roster_list_item.rs
index 46ac1cc..9b884f7 100644
--- a/src/components/roster_list/roster_list_item.rs
+++ b/src/components/roster_list/roster_list_item.rs
@@ -10,9 +10,7 @@ use crate::{chat::MacawChat, components::{avatar::AvatarWithPresence, sidebar::O
#[component]
pub fn RosterListItem(contact: MacawContact) -> impl IntoView {
let contact_contact: Store<Contact> = contact.contact;
- let contact_user: Store<User> =
- <ArcStore<filamento::user::User> as Clone>::clone(&contact.user).into();
- let name = move || get_name(contact_user, false);
+ let name = move || get_name(contact.user.get().unwrap().into(), false);
let open_chats: Store<OpenChatsPanel> =
use_context().expect("no open chats panel store in context");
@@ -20,10 +18,10 @@ pub fn RosterListItem(contact: MacawContact) -> impl IntoView {
// TODO: why can this not be in the closure?????
// TODO: not good, as overwrites preexisting chat state with possibly incorrect one...
let chat = Chat {
- correspondent: contact_user.jid().get(),
+ correspondent: contact.user.get().unwrap().jid().get(),
have_chatted: false,
};
- let chat = MacawChat::got_chat_and_user(chat, contact_user.get());
+ let chat = MacawChat::got_chat_and_user(chat, contact.user.get().unwrap().get());
let open_chat = move |_| {
debug!("opening chat");
@@ -33,14 +31,14 @@ pub fn RosterListItem(contact: MacawContact) -> impl IntoView {
let open = move || {
if let Some(open_chat) = &*open_chats.chat_view().read() {
debug!("got open chat: {:?}", open_chat);
- if *open_chat == *contact_user.jid().read() {
+ if *open_chat == *contact.user.get().unwrap().jid().read() {
return Open::Focused;
}
}
if let Some(_backgrounded_chat) = open_chats
.chats()
.read()
- .get(contact_user.jid().read().deref())
+ .get(contact.user.get().unwrap().jid().read().deref())
{
return Open::Open;
}
@@ -51,7 +49,7 @@ pub fn RosterListItem(contact: MacawContact) -> impl IntoView {
view! {
<div class="roster-list-item" class:open=move || open() class:focused=move || focused() on:click=open_chat>
- <AvatarWithPresence user=contact_user />
+ <AvatarWithPresence user=contact.user.get().unwrap().into() />
<div class="item-info">
<div class="main-info"><p class="name">{name}<span class="jid"> - {move || contact_contact.user_jid().read().to_string()}</span></p></div>
<div class="sub-info">{move || contact_contact.subscription().read().to_string()}</div>