cleanup
This commit is contained in:
@@ -48,7 +48,10 @@ import useDocumentUploads from '../features/upload/useDocumentUploads';
|
||||
import useDocumentDragHandlers from '../features/upload/useDocumentDragHandlers';
|
||||
import useDocumentMutations from './useDocumentMutations';
|
||||
import useDetailWorkspace from '../../viewer/logic/useDetailWorkspace';
|
||||
import useWorkspaceTaxonomies from './useWorkspaceTaxonomies';
|
||||
import useTags from './useTags';
|
||||
import useCorrespondents from './useCorrespondents';
|
||||
import useDocumentCorrespondentActions from '../features/correspondents/useDocumentCorrespondentActions';
|
||||
import usePasskeys from '../../settings/usePasskeys';
|
||||
import useWorkspaceBreadcrumbs from '../logic/useWorkspaceBreadcrumbs';
|
||||
import useWorkspaceSelectionSync from '../features/selection/useWorkspaceSelectionSync';
|
||||
import type { DocumentId, FolderNodeId, Identifier } from '../../types/identifiers';
|
||||
@@ -484,17 +487,57 @@ const useDocumentsWorkspace = ({
|
||||
handleTagUpdate,
|
||||
handleTagDelete,
|
||||
setTags,
|
||||
tagLookupById,
|
||||
} = useTags({
|
||||
notifyApiError,
|
||||
setStatusMessage,
|
||||
tagManager,
|
||||
tenantIdRef,
|
||||
setActiveTagFilters,
|
||||
mapDocumentCaches,
|
||||
});
|
||||
|
||||
useEffect(() => {
|
||||
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 {
|
||||
correspondents,
|
||||
refreshCorrespondents,
|
||||
handleCorrespondentCreate,
|
||||
handleCorrespondentUpdate,
|
||||
handleCorrespondentDelete,
|
||||
setCorrespondents,
|
||||
} = useCorrespondents({
|
||||
notifyApiError,
|
||||
setStatusMessage,
|
||||
tenantIdRef,
|
||||
mapDocumentCaches,
|
||||
});
|
||||
|
||||
const {
|
||||
correspondentLookupByName,
|
||||
handleDocumentCorrespondentAttach,
|
||||
handleCorrespondentRemove,
|
||||
handleCorrespondentAdd,
|
||||
} = useDocumentCorrespondentActions({
|
||||
correspondents,
|
||||
handleCorrespondentCreate,
|
||||
notifyApiError,
|
||||
setStatusMessage,
|
||||
updateDocumentCaches,
|
||||
});
|
||||
|
||||
const {
|
||||
passkeys,
|
||||
passkeysSupported,
|
||||
passkeysLoading,
|
||||
@@ -503,15 +546,9 @@ const useDocumentsWorkspace = ({
|
||||
refreshPasskeys,
|
||||
registerPasskey,
|
||||
revokePasskey,
|
||||
} = useWorkspaceTaxonomies({
|
||||
} = usePasskeys({
|
||||
notifyApiError,
|
||||
setStatusMessage,
|
||||
tagManager,
|
||||
tenantIdRef,
|
||||
currentTenantId,
|
||||
setActiveTagFilters,
|
||||
mapDocumentCaches,
|
||||
updateDocumentCaches,
|
||||
token,
|
||||
});
|
||||
|
||||
|
||||
Reference in New Issue
Block a user