ui fix peer filtering
This commit is contained in:
@@ -48,7 +48,8 @@ const App = () => {
|
|||||||
const getFilteredGames = (games: Game[], filter: GameFilter): Game[] => {
|
const getFilteredGames = (games: Game[], filter: GameFilter): Game[] => {
|
||||||
switch (filter) {
|
switch (filter) {
|
||||||
case 'available':
|
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':
|
case 'installed':
|
||||||
return games.filter(game => game.installed);
|
return games.filter(game => game.installed);
|
||||||
case 'all':
|
case 'all':
|
||||||
@@ -403,18 +404,21 @@ const App = () => {
|
|||||||
<button
|
<button
|
||||||
className={`filter-button ${currentFilter === 'all' ? 'active' : ''}`}
|
className={`filter-button ${currentFilter === 'all' ? 'active' : ''}`}
|
||||||
onClick={() => setCurrentFilter('all')}
|
onClick={() => setCurrentFilter('all')}
|
||||||
|
title="Show all games, regardless of installation status or peer availability"
|
||||||
>
|
>
|
||||||
All Games
|
All Games
|
||||||
</button>
|
</button>
|
||||||
<button
|
<button
|
||||||
className={`filter-button ${currentFilter === 'available' ? 'active' : ''}`}
|
className={`filter-button ${currentFilter === 'available' ? 'active' : ''}`}
|
||||||
onClick={() => setCurrentFilter('available')}
|
onClick={() => setCurrentFilter('available')}
|
||||||
|
title="Show games that are either installed or have peers available for download"
|
||||||
>
|
>
|
||||||
Available
|
Available
|
||||||
</button>
|
</button>
|
||||||
<button
|
<button
|
||||||
className={`filter-button ${currentFilter === 'installed' ? 'active' : ''}`}
|
className={`filter-button ${currentFilter === 'installed' ? 'active' : ''}`}
|
||||||
onClick={() => setCurrentFilter('installed')}
|
onClick={() => setCurrentFilter('installed')}
|
||||||
|
title="Show only games that are currently installed on your system"
|
||||||
>
|
>
|
||||||
Installed
|
Installed
|
||||||
</button>
|
</button>
|
||||||
|
|||||||
Reference in New Issue
Block a user