diff --git a/src/app/main/game/page.tsx b/src/app/main/game/page.tsx
index f36871c..6305881 100644
--- a/src/app/main/game/page.tsx
+++ b/src/app/main/game/page.tsx
@@ -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 (
@@ -191,19 +201,22 @@ export default function Installs () {
)
})}
- {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)
- )
- })
+ {filteredVersions.length === 0 &&
+ (category !== -1 ||
+ 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
+ }).length === 0) && (
+
+
No versions installed
+
+ )}
+ {filteredVersions
.sort((a, b) => {
const infoA = serverVersionList?.versions.find(vf => vf.id == a)
const infoB = serverVersionList?.versions.find(vf => vf.id == b)
diff --git a/src/app/main/page.tsx b/src/app/main/page.tsx
index e75c187..548d1bb 100644
--- a/src/app/main/page.tsx
+++ b/src/app/main/page.tsx
@@ -32,6 +32,13 @@ export default function Installs () {
setSelectedVersionList([])
}, [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 (
@@ -57,13 +64,12 @@ export default function Installs () {
: 'h-[calc(100vh-84px)]'
}`}
>
- {serverVersionList?.games
- .filter(g =>
- serverVersionList.versions
- .filter(v => v.game === g.id)
- .some(v => Object.keys(versionsList).includes(v.id))
- )
- .map(i => (
+ {filteredGames.length == 0 ? (
+
+ ) : (
+ filteredGames.map(i => (
{(() => {
- const gameVersions =
- serverVersionList.versions.filter(
- v => v.game === i.id
- )
+ const gameVersions = (
+ serverVersionList?.versions ?? []
+ ).filter(v => v.game === i.id)
const installed = gameVersions.filter(v =>
Object.keys(versionsList).includes(v.id)
).length
@@ -126,7 +131,8 @@ export default function Installs () {
- ))}
+ ))
+ )}