Make it say there is no versions available if there are none, rather than showing nothing

This commit is contained in:
Lncvrt committed 2026-05-01 13:15:46 -07:00
1 parent 3e45caf4f3
commit abeeab79d7
4 files changed
+88 -69

No files matched your search

+21 -7
View File
@@ -6,20 +6,28 @@ import {
import { FontAwesomeIcon } from '@fortawesome/react-fontawesome'
export default function GamesDownloadPopup () {
const { serverVersionList, setSelectedGame } = useGlobal()
const {
serverVersionList,
setSelectedGame,
setManagingGame,
setPopupMode,
setShowPopup,
setFadeOut,
setViewingInfoFromDownloads
} = useGlobal()
return (
<>
<p className='text-xl text-center'>Select a game to download</p>
<div className='popup-content'>
{serverVersionList?.games
.filter(i => {
.filter(g => {
const gameVersions = serverVersionList.versions.filter(
vf => vf.game === i.id
gv => gv.game === g.id
)
if (gameVersions.length > 0) return true
})
.map((v, i) => (
.map((g, i) => (
<div
key={i}
className='popup-entry grid items-center gap-3'
@@ -27,15 +35,21 @@ export default function GamesDownloadPopup () {
>
<button
className='button btntheme3'
onClick={() => setSelectedGame(v.id)}
onClick={() => {
setViewingInfoFromDownloads(true)
setManagingGame(g.id)
setPopupMode(5)
setShowPopup(true)
setFadeOut(false)
}}
title='Click to view game info.'
>
<FontAwesomeIcon icon={faInfo} /> Info
</button>
<p className='text-2xl text-center truncate'>{v.name}</p>
<p className='text-2xl text-center truncate'>{g.name}</p>
<button
className='button btntheme3'
onClick={() => setSelectedGame(v.id)}
onClick={() => setSelectedGame(g.id)}
title='Click to view more versions of the game.'
>
<FontAwesomeIcon icon={faArrowUpRightFromSquare} /> View