cleanup
This commit is contained in:
@@ -16,9 +16,9 @@ import { useWorkspaceSelectionContext } from '../app/WorkspaceSelectionContext';
|
||||
const ROOT_FOLDER_LABEL = 'Documents';
|
||||
|
||||
type DocumentId = string | number;
|
||||
type NullableDocumentId = DocumentId | null | undefined;
|
||||
type NullableDocumentId = DocumentId | null;
|
||||
|
||||
type SelectedIdList = Array<NullableDocumentId> | null | undefined;
|
||||
type SelectedIdList = NullableDocumentId[] | null;
|
||||
|
||||
type FolderTreeNode = {
|
||||
id?: DocumentId;
|
||||
@@ -137,8 +137,8 @@ const buildFolderTreeOptions = (tree?: FolderTreeNode[] | null): SelectionAssign
|
||||
|
||||
const buildTagAssignments = (
|
||||
selectedDocuments: DocumentLike[],
|
||||
tagLookupById: Map<DocumentId, TagOption> | null | undefined,
|
||||
tags: TagOption[] | null | undefined,
|
||||
tagLookupById: Map<DocumentId, TagOption> | null,
|
||||
tags: TagOption[] | null,
|
||||
total: number,
|
||||
): SelectionAssignmentMenuItem[] => {
|
||||
if (!total) {
|
||||
@@ -202,7 +202,7 @@ const buildTagAssignments = (
|
||||
|
||||
const buildCorrespondentAssignments = (
|
||||
selectedDocuments: DocumentLike[],
|
||||
correspondents: CorrespondentOption[] | null | undefined,
|
||||
correspondents: CorrespondentOption[] | null,
|
||||
total: number,
|
||||
): SelectionAssignmentMenuItem[] => {
|
||||
if (!total) {
|
||||
@@ -493,7 +493,7 @@ const SelectionFloatingActions: React.FC<SelectionFloatingActionsProps> = ({
|
||||
if (!documentIdList.length || !onMoveDocumentsToFolder) {
|
||||
return;
|
||||
}
|
||||
const candidate = option as { id?: DocumentId; value?: DocumentId } | DocumentId | null | undefined;
|
||||
const candidate = option as { id?: DocumentId; value?: DocumentId } | DocumentId | null;
|
||||
const value = isRecord(candidate)
|
||||
? (candidate?.id ?? candidate?.value ?? null)
|
||||
: candidate;
|
||||
|
||||
Reference in New Issue
Block a user