Re-add this back
This commit is contained in:
2 files changed
+44
-25
No files matched your search
+26
-13
@@ -57,6 +57,16 @@ export default function Installs () {
|
|||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
const filteredVersions = Object.keys(versionsList).filter(v => {
|
||||||
|
const info = serverVersionList?.versions.find(vf => vf.id == v)
|
||||||
|
if (!info) return false
|
||||||
|
if (platform() == 'linux' && info.wine && !linuxUseWine) return false
|
||||||
|
return (
|
||||||
|
info.game === id &&
|
||||||
|
(category == -1 ? info.category == -1 : info.category == category)
|
||||||
|
)
|
||||||
|
})
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<div className='mx-4 mt-4'>
|
<div className='mx-4 mt-4'>
|
||||||
<div className='flex justify-between items-center mb-4'>
|
<div className='flex justify-between items-center mb-4'>
|
||||||
@@ -191,19 +201,22 @@ export default function Installs () {
|
|||||||
</div>
|
</div>
|
||||||
)
|
)
|
||||||
})}
|
})}
|
||||||
{Object.keys(versionsList)
|
{filteredVersions.length === 0 &&
|
||||||
.filter(v => {
|
(category !== -1 ||
|
||||||
const info = serverVersionList?.versions.find(vf => vf.id == v)
|
Object.keys(versionsList).filter(v => {
|
||||||
if (!info) return false
|
const info = serverVersionList?.versions.find(vf => vf.id == v)
|
||||||
if (platform() == 'linux' && info.wine && !linuxUseWine)
|
if (!info) return false
|
||||||
return false
|
|
||||||
return (
|
if (platform() == 'linux' && info.wine && !linuxUseWine)
|
||||||
info.game === id &&
|
return false
|
||||||
(category == -1
|
|
||||||
? info.category == -1
|
return info.game === id
|
||||||
: info.category == category)
|
}).length === 0) && (
|
||||||
)
|
<div className='flex justify-center items-center h-full'>
|
||||||
})
|
<p className='text-3xl'>No versions installed</p>
|
||||||
|
</div>
|
||||||
|
)}
|
||||||
|
{filteredVersions
|
||||||
.sort((a, b) => {
|
.sort((a, b) => {
|
||||||
const infoA = serverVersionList?.versions.find(vf => vf.id == a)
|
const infoA = serverVersionList?.versions.find(vf => vf.id == a)
|
||||||
const infoB = serverVersionList?.versions.find(vf => vf.id == b)
|
const infoB = serverVersionList?.versions.find(vf => vf.id == b)
|
||||||
|
|||||||
+18
-12
@@ -32,6 +32,13 @@ export default function Installs () {
|
|||||||
setSelectedVersionList([])
|
setSelectedVersionList([])
|
||||||
}, [setSelectedVersionList, showPopup])
|
}, [setSelectedVersionList, showPopup])
|
||||||
|
|
||||||
|
const filteredGames =
|
||||||
|
serverVersionList?.games.filter(g =>
|
||||||
|
serverVersionList.versions
|
||||||
|
.filter(v => v.game === g.id)
|
||||||
|
.some(v => Object.keys(versionsList).includes(v.id))
|
||||||
|
) ?? []
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<div className='mx-4 mt-4'>
|
<div className='mx-4 mt-4'>
|
||||||
<div className='flex justify-between items-center mb-4'>
|
<div className='flex justify-between items-center mb-4'>
|
||||||
@@ -57,13 +64,12 @@ export default function Installs () {
|
|||||||
: 'h-[calc(100vh-84px)]'
|
: 'h-[calc(100vh-84px)]'
|
||||||
}`}
|
}`}
|
||||||
>
|
>
|
||||||
{serverVersionList?.games
|
{filteredGames.length == 0 ? (
|
||||||
.filter(g =>
|
<div className='flex justify-center items-center h-full'>
|
||||||
serverVersionList.versions
|
<p className='text-3xl'>No games installed</p>
|
||||||
.filter(v => v.game === g.id)
|
</div>
|
||||||
.some(v => Object.keys(versionsList).includes(v.id))
|
) : (
|
||||||
)
|
filteredGames.map(i => (
|
||||||
.map(i => (
|
|
||||||
<div
|
<div
|
||||||
key={i.id}
|
key={i.id}
|
||||||
className={'downloads-entry'}
|
className={'downloads-entry'}
|
||||||
@@ -84,10 +90,9 @@ export default function Installs () {
|
|||||||
>
|
>
|
||||||
<p>
|
<p>
|
||||||
{(() => {
|
{(() => {
|
||||||
const gameVersions =
|
const gameVersions = (
|
||||||
serverVersionList.versions.filter(
|
serverVersionList?.versions ?? []
|
||||||
v => v.game === i.id
|
).filter(v => v.game === i.id)
|
||||||
)
|
|
||||||
const installed = gameVersions.filter(v =>
|
const installed = gameVersions.filter(v =>
|
||||||
Object.keys(versionsList).includes(v.id)
|
Object.keys(versionsList).includes(v.id)
|
||||||
).length
|
).length
|
||||||
@@ -126,7 +131,8 @@ export default function Installs () {
|
|||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
))}
|
))
|
||||||
|
)}
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
Reference in new issue
Block a user