fixes
This commit is contained in:
@@ -70,6 +70,7 @@ const DocumentsTable = ({
|
||||
getDocumentAsset = () => null,
|
||||
getDownloadHref,
|
||||
onTagClick,
|
||||
isSearchLoading = false,
|
||||
}) => {
|
||||
const showingSearchResults = searchResults !== null;
|
||||
const rows = showingSearchResults ? searchResults : documents;
|
||||
@@ -453,7 +454,7 @@ const DocumentsTable = ({
|
||||
</table>
|
||||
)}
|
||||
</div>
|
||||
{rows.length === 0 && isFilterActive && (
|
||||
{rows.length === 0 && showingSearchResults && !isSearchLoading && (
|
||||
<div className="empty-state">No documents match the current filters.</div>
|
||||
)}
|
||||
{showingSearchResults && rows.length > 0 && (
|
||||
|
||||
@@ -430,6 +430,7 @@ const AppLayout = () => {
|
||||
setSearchQuery('');
|
||||
setActiveTagFilters([]);
|
||||
setActiveCorrespondentFilters([]);
|
||||
setSearchLoading(false);
|
||||
}, []);
|
||||
|
||||
const handleSearchSubmit = useCallback(() => {
|
||||
@@ -449,6 +450,7 @@ const AppLayout = () => {
|
||||
const [activePreviewId, setActivePreviewId] = useState(routeDocumentId || null);
|
||||
const [previewDocumentId, setPreviewDocumentId] = useState(null);
|
||||
const [previewDocumentLoading, setPreviewDocumentLoading] = useState(false);
|
||||
const [searchLoading, setSearchLoading] = useState(false);
|
||||
const shellRef = useRef(null);
|
||||
const assetManagerRef = useRef(null);
|
||||
if (!assetManagerRef.current) {
|
||||
@@ -3644,11 +3646,13 @@ const AppLayout = () => {
|
||||
|
||||
if (!isFilterActive) {
|
||||
setSearchResults(null);
|
||||
setSearchLoading(false);
|
||||
return undefined;
|
||||
}
|
||||
|
||||
let cancelled = false;
|
||||
let started = false;
|
||||
setSearchLoading(true);
|
||||
|
||||
const debounce = setTimeout(async () => {
|
||||
started = true;
|
||||
@@ -3676,6 +3680,7 @@ const AppLayout = () => {
|
||||
setSearchResults(results);
|
||||
|
||||
if (!results.length) {
|
||||
setSearchLoading(false);
|
||||
setSelectedRowKeys([]);
|
||||
setFocusedDocumentId(null);
|
||||
selectionOrderRef.current = [];
|
||||
@@ -3726,6 +3731,7 @@ const AppLayout = () => {
|
||||
} finally {
|
||||
if (!cancelled && started) {
|
||||
setLoading(false);
|
||||
setSearchLoading(false);
|
||||
}
|
||||
}
|
||||
}, 300);
|
||||
@@ -3735,6 +3741,7 @@ const AppLayout = () => {
|
||||
clearTimeout(debounce);
|
||||
if (started) {
|
||||
setLoading(false);
|
||||
setSearchLoading(false);
|
||||
}
|
||||
};
|
||||
}, [
|
||||
@@ -3878,9 +3885,6 @@ const AppLayout = () => {
|
||||
notifyApiError(error, 'Failed to load folder.');
|
||||
}
|
||||
}
|
||||
if (folderId === 'root') {
|
||||
return;
|
||||
}
|
||||
setFolderNodes((prev) => {
|
||||
const next = new Map(prev);
|
||||
const current = next.get(folderId);
|
||||
@@ -4312,6 +4316,7 @@ const AppLayout = () => {
|
||||
draggingDocumentIds: draggedDocumentIds,
|
||||
onDocumentDragStart: handleDocumentDragStart,
|
||||
onDocumentDragEnd: handleDocumentDragEnd,
|
||||
isSearchLoading: searchLoading,
|
||||
tagLookupById,
|
||||
onDocumentListFocus: handleDocumentListFocus,
|
||||
onDocumentListKeyDown: handleDocumentListKeyDown,
|
||||
|
||||
Reference in New Issue
Block a user