simplify frontend document and folder memoization.

This commit is contained in:
2025-12-09 02:03:46 +01:00
parent 1d127e2122
commit 24950e1a12
4 changed files with 81 additions and 164 deletions
@@ -458,15 +458,12 @@ const useDocumentsWorkspace = ({
tenantIdRef.current = currentTenantId;
}, [currentTenantId, tenantIdRef]);
const tagLookupById = useMemo(() => {
const map = new Map();
tags.forEach((tag) => {
if (tag?.id) {
map.set(tag.id, tag);
}
});
return map;
}, [tags]);
const tagLookupById = new Map();
tags.forEach((tag) => {
if (tag?.id) {
tagLookupById.set(tag.id, tag);
}
});
const tagsState = {
...tagsStateRaw,