simplify frontend document and folder memoization.
This commit is contained in:
@@ -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,
|
||||
|
||||
Reference in New Issue
Block a user