From c5b641e85fad7468e7a69c5ae8b62a515c8cc9fe Mon Sep 17 00:00:00 2001 From: Brayan Vargas <86427419+b-avb@users.noreply.github.com> Date: Wed, 28 Feb 2024 08:23:01 -0500 Subject: [PATCH] fix: change room action doesn't render messages (#50) --- src/hooks/use_chat.rs | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/hooks/use_chat.rs b/src/hooks/use_chat.rs index e370081..a385444 100644 --- a/src/hooks/use_chat.rs +++ b/src/hooks/use_chat.rs @@ -137,6 +137,14 @@ pub fn use_chat(cx: &ScopeState) -> &UseChatState { } }); + use_effect(cx, &(room.get().id), |id| { + to_owned![task_timeline, from]; + async move { + from.set(None); + task_timeline.send(true); + } + }); + cx.use_hook(move || UseChatState { inner: ChatState { messages: messages.get().clone(),