Skip to content

Commit 0cf6ae8

Browse files
committed
chore: put back error for download logic
1 parent 84322a7 commit 0cf6ae8

1 file changed

Lines changed: 6 additions & 0 deletions

File tree

src/context/filterContext.tsx

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -127,6 +127,12 @@ export const FilterProvider: React.FC<FilterProviderProps> = ({ children, subjec
127127
}, []);
128128

129129
const handleDownloadSelected = useCallback(async () => {
130+
131+
if (selectedPapers.length === 0) {
132+
toast.error("No papers selected for download.");
133+
return;
134+
}
135+
130136
const zip = new JSZip();
131137
const uniquePapers = Array.from(
132138
new Set(selectedPapers.map((paper) => paper._id)),

0 commit comments

Comments
 (0)