Fix games that can't even be installed showing up

This commit is contained in:
2026-02-04 16:56:25 -07:00
parent fbe3feec9d
commit 6e05aac871

View File

@@ -597,7 +597,13 @@ export default function RootLayout ({
Select a game to download Select a game to download
</p> </p>
<div className='popup-content'> <div className='popup-content'>
{serverVersionList?.games.map((v, i) => ( {serverVersionList?.games
.filter(v => {
const data = getVersionsAmountData(v.id)
if (!data) return false
if (data.total > 0) return true
})
.map((v, i) => (
<div key={i} className='popup-entry'> <div key={i} className='popup-entry'>
<p className='text-2xl'>{v.name}</p> <p className='text-2xl'>{v.name}</p>
<div className='flex gap-2'> <div className='flex gap-2'>
@@ -607,7 +613,9 @@ export default function RootLayout ({
> >
<p> <p>
{(() => { {(() => {
const data = getVersionsAmountData(v.id) const data = getVersionsAmountData(
v.id
)
if (!data) return 'N/A' if (!data) return 'N/A'
return `${data.installed}/${data.total}` return `${data.installed}/${data.total}`
})()}{' '} })()}{' '}
@@ -636,9 +644,13 @@ export default function RootLayout ({
> >
<FontAwesomeIcon <FontAwesomeIcon
icon={ icon={
v.verified ? faShieldHalved : faWarning v.verified
? faShieldHalved
: faWarning
}
color={
v.verified ? '#19c84b' : '#ffc800'
} }
color={v.verified ? '#19c84b' : '#ffc800'}
/> />
<p> <p>
{v.verified ? 'Verified' : 'Unverified'} {v.verified ? 'Verified' : 'Unverified'}