From 75d52c771f11bcca0c9a16554aa7626a943f92a3 Mon Sep 17 00:00:00 2001 From: Michel Roegl-Brunner Date: Fri, 7 Nov 2025 12:42:57 +0100 Subject: [PATCH] Fix: Include 'New' scripts in Download All Filtered when no filters are active - Modified handleDownloadAllFiltered to combine filteredScripts and newestScripts when no filters are active - Ensures all scripts including those in the 'Newest Scripts' carousel are downloaded - Maintains existing behavior when filters are active - Fixes issue where 'New' scripts were excluded from downloads --- src/app/_components/ScriptsGrid.tsx | 25 ++++++++++++++++++++++++- 1 file changed, 24 insertions(+), 1 deletion(-) diff --git a/src/app/_components/ScriptsGrid.tsx b/src/app/_components/ScriptsGrid.tsx index 1dea71e..9319063 100644 --- a/src/app/_components/ScriptsGrid.tsx +++ b/src/app/_components/ScriptsGrid.tsx @@ -535,7 +535,30 @@ export function ScriptsGrid({ onInstallScript }: ScriptsGridProps) { }; const handleDownloadAllFiltered = () => { - const slugsToDownload = filteredScripts.map(script => script.slug).filter(Boolean); + + let scriptsToDownload: ScriptCardType[] = filteredScripts; + + if (!hasActiveFilters) { + + const scriptMap = new Map(); + + filteredScripts.forEach(script => { + if (script?.slug) { + scriptMap.set(script.slug, script); + } + }); + + + newestScripts.forEach(script => { + if (script?.slug && !scriptMap.has(script.slug)) { + scriptMap.set(script.slug, script); + } + }); + + scriptsToDownload = Array.from(scriptMap.values()); + } + + const slugsToDownload = scriptsToDownload.map(script => script.slug).filter(Boolean); if (slugsToDownload.length > 0) { void downloadScriptsIndividually(slugsToDownload); }