Skip to content

Commit 9ad9440

Browse files
author
auto-bot
committed
fix: resolve script filtering count discrepancy
- Map 'turnkey' script type to 'ct' category in filtering logic - Fixes issue where filtering by all 4 types showed 398/399 instead of 399/399 - Applied to both DownloadedScriptsTab and ScriptsGrid components - TurnKey script is LXC-related so mapping to 'ct' is appropriate
1 parent fcb9aaf commit 9ad9440

File tree

2 files changed

+10
-2
lines changed

2 files changed

+10
-2
lines changed

src/app/_components/DownloadedScriptsTab.tsx

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -275,7 +275,11 @@ export function DownloadedScriptsTab({ onInstallScript }: DownloadedScriptsTabPr
275275
scripts = scripts.filter(script => {
276276
if (!script) return false;
277277
const scriptType = (script.type ?? '').toLowerCase();
278-
return filters.selectedTypes.some(type => type.toLowerCase() === scriptType);
278+
279+
// Map non-standard types to standard categories
280+
const mappedType = scriptType === 'turnkey' ? 'ct' : scriptType;
281+
282+
return filters.selectedTypes.some(type => type.toLowerCase() === mappedType);
279283
});
280284
}
281285

src/app/_components/ScriptsGrid.tsx

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -303,7 +303,11 @@ export function ScriptsGrid({ onInstallScript }: ScriptsGridProps) {
303303
scripts = scripts.filter(script => {
304304
if (!script) return false;
305305
const scriptType = (script.type ?? '').toLowerCase();
306-
return filters.selectedTypes.some(type => type.toLowerCase() === scriptType);
306+
307+
// Map non-standard types to standard categories
308+
const mappedType = scriptType === 'turnkey' ? 'ct' : scriptType;
309+
310+
return filters.selectedTypes.some(type => type.toLowerCase() === mappedType);
307311
});
308312
}
309313

0 commit comments

Comments
 (0)