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:
@@ -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);
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -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);
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user