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
This commit is contained in:
auto-bot
2025-10-20 16:03:29 +02:00
parent fcb9aafc8d
commit 9ad9440b0f
2 changed files with 10 additions and 2 deletions

View File

@@ -275,7 +275,11 @@ export function DownloadedScriptsTab({ onInstallScript }: DownloadedScriptsTabPr
scripts = scripts.filter(script => { scripts = scripts.filter(script => {
if (!script) return false; if (!script) return false;
const scriptType = (script.type ?? '').toLowerCase(); const scriptType = (script.type ?? '').toLowerCase();
return filters.selectedTypes.some(type => type.toLowerCase() === scriptType);
// Map non-standard types to standard categories
const mappedType = scriptType === 'turnkey' ? 'ct' : scriptType;
return filters.selectedTypes.some(type => type.toLowerCase() === mappedType);
}); });
} }

View File

@@ -303,7 +303,11 @@ export function ScriptsGrid({ onInstallScript }: ScriptsGridProps) {
scripts = scripts.filter(script => { scripts = scripts.filter(script => {
if (!script) return false; if (!script) return false;
const scriptType = (script.type ?? '').toLowerCase(); const scriptType = (script.type ?? '').toLowerCase();
return filters.selectedTypes.some(type => type.toLowerCase() === scriptType);
// Map non-standard types to standard categories
const mappedType = scriptType === 'turnkey' ? 'ct' : scriptType;
return filters.selectedTypes.some(type => type.toLowerCase() === mappedType);
}); });
} }