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,81 +597,93 @@ 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
<div key={i} className='popup-entry'> .filter(v => {
<p className='text-2xl'>{v.name}</p> const data = getVersionsAmountData(v.id)
<div className='flex gap-2'> if (!data) return false
<div if (data.total > 0) return true
className='entry-info-item btntheme3' })
title='The amount of versions installed of this game in installed/installable format.' .map((v, i) => (
> <div key={i} className='popup-entry'>
<p> <p className='text-2xl'>{v.name}</p>
{(() => { <div className='flex gap-2'>
const data = getVersionsAmountData(v.id) <div
if (!data) return 'N/A' className='entry-info-item btntheme3'
return `${data.installed}/${data.total}` title='The amount of versions installed of this game in installed/installable format.'
})()}{' '} >
versions installed <p>
</p> {(() => {
</div> const data = getVersionsAmountData(
<div v.id
className='entry-info-item btntheme3' )
hidden={!v.official} if (!data) return 'N/A'
title='This game is official.' return `${data.installed}/${data.total}`
> })()}{' '}
<FontAwesomeIcon versions installed
icon={faCheck} </p>
color='#19c84b' </div>
/> <div
<p>Official</p> className='entry-info-item btntheme3'
</div> hidden={!v.official}
<div title='This game is official.'
className='entry-info-item btntheme3' >
hidden={v.official} <FontAwesomeIcon
title={ icon={faCheck}
v.verified color='#19c84b'
? 'This game is verified to be safe' />
: 'This game is NOT verified to be save. Proceed with caution.' <p>Official</p>
} </div>
> <div
<FontAwesomeIcon className='entry-info-item btntheme3'
icon={ hidden={v.official}
v.verified ? faShieldHalved : faWarning title={
v.verified
? 'This game is verified to be safe'
: 'This game is NOT verified to be save. Proceed with caution.'
} }
color={v.verified ? '#19c84b' : '#ffc800'} >
/> <FontAwesomeIcon
<p> icon={
{v.verified ? 'Verified' : 'Unverified'} v.verified
</p> ? faShieldHalved
: faWarning
}
color={
v.verified ? '#19c84b' : '#ffc800'
}
/>
<p>
{v.verified ? 'Verified' : 'Unverified'}
</p>
</div>
</div> </div>
<div
className='entry-info-item btntheme3 mt-2'
hidden={v.developer == null}
title={`The developer of ${v.name} is ${v.developer}.`}
>
<FontAwesomeIcon
icon={faCode}
color='lightgray'
/>
<p>Developer: {v.developer}</p>
</div>
<button
className='button btntheme3 right-2 bottom-2'
onClick={() => setSelectedGame(v.id)}
title={`Click to download specific versions of the game. You have ${(() => {
const data = getVersionsAmountData(v.id)
if (!data) return 'N/A'
return `${data.installed} of ${data.total}`
})()} versions downloaded.`}
>
<>
<FontAwesomeIcon icon={faDownload} />{' '}
Download
</>
</button>
</div> </div>
<div ))}
className='entry-info-item btntheme3 mt-2'
hidden={v.developer == null}
title={`The developer of ${v.name} is ${v.developer}.`}
>
<FontAwesomeIcon
icon={faCode}
color='lightgray'
/>
<p>Developer: {v.developer}</p>
</div>
<button
className='button btntheme3 right-2 bottom-2'
onClick={() => setSelectedGame(v.id)}
title={`Click to download specific versions of the game. You have ${(() => {
const data = getVersionsAmountData(v.id)
if (!data) return 'N/A'
return `${data.installed} of ${data.total}`
})()} versions downloaded.`}
>
<>
<FontAwesomeIcon icon={faDownload} />{' '}
Download
</>
</button>
</div>
))}
</div> </div>
</> </>
) : popupMode === 1 ? ( ) : popupMode === 1 ? (