dev #6

Merged
ryanmwangi merged 10 commits from dev into main 2025-04-01 13:19:03 +00:00
2 changed files with 7 additions and 2 deletions
Showing only changes of commit 9d21d9999f - Show all commits

3
.gitignore vendored
View file

@ -18,4 +18,5 @@ playwright/.cache/
.idea/ .idea/
# Ignore database file # Ignore database file
compareware.db compareware.db
.qodo

View file

@ -397,6 +397,7 @@ pub fn ItemsList(
property_cache: ReadSignal<HashMap<String, HashMap<String, String>>>, property_cache: ReadSignal<HashMap<String, HashMap<String, String>>>,
set_property_cache: WriteSignal<HashMap<String, HashMap<String, String>>>, set_property_cache: WriteSignal<HashMap<String, HashMap<String, String>>>,
property_labels: ReadSignal<HashMap<String, String>>, property_labels: ReadSignal<HashMap<String, String>>,
set_is_fetching_labels: WriteSignal<bool>,
) -> HashMap<String, String> { ) -> HashMap<String, String> {
// Check cache first // Check cache first
@ -453,6 +454,7 @@ pub fn ItemsList(
.collect(); .collect();
if !missing_ids.is_empty() { if !missing_ids.is_empty() {
let new_labels = fetch_property_labels( let new_labels = fetch_property_labels(
missing_ids, missing_ids,
set_property_labels.clone(), set_property_labels.clone(),
@ -696,6 +698,7 @@ pub fn ItemsList(
property_cache.clone(), property_cache.clone(),
set_property_cache.clone(), set_property_cache.clone(),
property_labels.clone(), property_labels.clone(),
set_is_fetching_labels.clone()
) )
.await; .await;
// Update fetched properties and property labels // Update fetched properties and property labels
@ -746,6 +749,7 @@ pub fn ItemsList(
property_cache.clone(), property_cache.clone(),
set_property_cache.clone(), set_property_cache.clone(),
property_labels.clone(), property_labels.clone(),
set_is_fetching_labels.clone()
) )
.await; .await;
log!("Fetched properties for index {}: {:?}", index, properties); log!("Fetched properties for index {}: {:?}", index, properties);
@ -897,7 +901,7 @@ pub fn ItemsList(
// Fetch additional properties from Wikidata // Fetch additional properties from Wikidata
let wikidata_id = id.clone(); let wikidata_id = id.clone();
spawn_local(async move { spawn_local(async move {
let properties = fetch_item_properties(&wikidata_id, set_property_labels.clone(), property_cache.clone(), set_property_cache.clone(), property_labels.clone()).await; let properties = fetch_item_properties(&wikidata_id, set_property_labels.clone(), property_cache.clone(), set_property_cache.clone(), property_labels.clone(),set_is_fetching_labels.clone()).await;
// log!("Fetched properties for Wikidata ID {}: {:?}", wikidata_id, properties); // log!("Fetched properties for Wikidata ID {}: {:?}", wikidata_id, properties);
// Populate the custom properties for the new item // Populate the custom properties for the new item