refactor: ensure robust event file retrieval from Dexie cache

- Reverted 'element_manage_event_file_li_direct.svelte' to use 'for_type' and 'for_id' for cache-aware filtering.
- Enhanced 'element_manage_event_file_li_all.svelte' with a combined filter for specific and generic IDs.
- Verified that ID synchronization in 'process_ae_obj__event_file_props' supports these retrieval patterns.
This commit is contained in:
Scott Idem
2026-02-06 16:45:10 -05:00
parent df9d3ad3d2
commit 7b61145a66
2 changed files with 13 additions and 2 deletions

View File

@@ -48,6 +48,15 @@
let results = await db_events.file
.where(dq__where_val)
.equals(dq__where_eq_val)
.or('for_id')
.equals(dq__where_eq_val)
.filter((file) => {
// If using for_id, we should also verify for_type to avoid accidental cross-links
if (file.for_id === dq__where_eq_val) {
return file.for_type === link_to_type;
}
return true;
})
.reverse()
.sortBy('created_on');
// .toArray()