ui fix peer filtering

This commit is contained in:
2025-11-13 19:45:54 +01:00
parent b8d6d29ae0
commit f223418d22
+5 -1
View File
@@ -48,7 +48,8 @@ const App = () => {
const getFilteredGames = (games: Game[], filter: GameFilter): Game[] => {
switch (filter) {
case 'available':
return games.filter(game => game.peer_count > 0);
// Show union of installed games and games with peers
return games.filter(game => game.installed || game.peer_count > 0);
case 'installed':
return games.filter(game => game.installed);
case 'all':
@@ -403,18 +404,21 @@ const App = () => {
<button
className={`filter-button ${currentFilter === 'all' ? 'active' : ''}`}
onClick={() => setCurrentFilter('all')}
title="Show all games, regardless of installation status or peer availability"
>
All Games
</button>
<button
className={`filter-button ${currentFilter === 'available' ? 'active' : ''}`}
onClick={() => setCurrentFilter('available')}
title="Show games that are either installed or have peers available for download"
>
Available
</button>
<button
className={`filter-button ${currentFilter === 'installed' ? 'active' : ''}`}
onClick={() => setCurrentFilter('installed')}
title="Show only games that are currently installed on your system"
>
Installed
</button>