refactor: Standardize document and folder identification with a new entryKey module.
This commit is contained in:
@@ -2,11 +2,8 @@ import { useCallback, useEffect, useMemo } from 'react';
|
||||
import type { MutableRefObject } from 'react';
|
||||
import { resolveDocumentAssetUrl } from '../asset_manager';
|
||||
import { useDetailPanel } from '../app/useDetailPanel';
|
||||
import {
|
||||
DEFAULT_FOLDER_NAME,
|
||||
getRowId,
|
||||
isDocumentRowKey,
|
||||
} from '../app/workspaceUtils';
|
||||
import { DEFAULT_FOLDER_NAME } from '../app/workspaceUtils';
|
||||
import { getEntryId, isDocumentEntry } from '../app/entryKey';
|
||||
import type { DocumentInfoPanelProps } from '../documents/DocumentInfoPanel';
|
||||
import type { EnsureAssetUrl, GetDocumentAsset } from '../utils/ocr';
|
||||
|
||||
@@ -101,10 +98,10 @@ const useDetailWorkspace = ({
|
||||
};
|
||||
|
||||
selectionOrder.forEach((key) => {
|
||||
if (!isDocumentRowKey(key)) {
|
||||
if (!isDocumentEntry(key)) {
|
||||
return;
|
||||
}
|
||||
const docId = getRowId(key);
|
||||
const docId = getEntryId(key);
|
||||
const doc = documentLookup.get(docId) || null;
|
||||
pushDoc(doc);
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user