From c38f19d76cf64c3b18926ffd96efce8ceb27db2d Mon Sep 17 00:00:00 2001 From: ryan Date: Mon, 27 Jan 2025 16:48:28 +0300 Subject: [PATCH] feat(labels): persist property labels on refresh. --- src/components/items_list.rs | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/src/components/items_list.rs b/src/components/items_list.rs index 7aa55fd..616b738 100644 --- a/src/components/items_list.rs +++ b/src/components/items_list.rs @@ -74,10 +74,19 @@ pub fn ItemsList( } } } - log!("Custom properties: {:?}", custom_props); - log!("Updating custom properties signal: {:?}", custom_props); + + let custom_props_clone = custom_props.clone(); set_custom_properties.set(custom_props); + // Fetch labels for the custom properties + let property_ids = custom_props_clone; + let labels = fetch_property_labels(property_ids).await; + set_property_labels.update(|labels_map| { + for (key, value) in labels { + labels_map.insert(key, value); + } + }); + log!("Items after loading: {:?}", items.get()); } Err(err) => {