From 4a5aa6579f5184c443ffbe80ce93e0daa0926826 Mon Sep 17 00:00:00 2001 From: cel 🌸 Date: Mon, 2 Jun 2025 21:16:18 +0100 Subject: fix: put reactive calls in reactive contexts to update avatar on avatar update --- src/state_store.rs | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'src/state_store.rs') diff --git a/src/state_store.rs b/src/state_store.rs index 8d80b3f..ac90e40 100644 --- a/src/state_store.rs +++ b/src/state_store.rs @@ -1,6 +1,7 @@ use std::{collections::HashMap, ops::{Deref, DerefMut}, sync::{Arc, RwLock}}; use leptos::prelude::*; +use tracing::debug; // TODO: get rid of this // V has to be an arc signal @@ -105,7 +106,7 @@ impl Clone for StateStore { } } -impl StateStore +impl StateStore where K: Send + Sync + 'static, V: Send + Sync + 'static, @@ -114,7 +115,9 @@ where { let store = self.inner.try_get_value().unwrap(); let mut store = store.store.write().unwrap(); + debug!("store state: {:?}", store); if let Some((v, count)) = store.get_mut(&key) { + debug!("updating old value already in store"); v.set(value); *count += 1; StateListener { @@ -127,6 +130,7 @@ where } else { let v = ArcRwSignal::new(value); store.insert(key.clone(), (v.clone(), 1)); + debug!("inserting new value: {:?}", store); StateListener { value: v.into(), cleaner: StateCleaner { -- cgit