Add categories to sidebar

This commit is contained in:
2026-02-10 14:23:37 -07:00
parent 3c7487f20f
commit abebc0bb08
5 changed files with 110 additions and 39 deletions

View File

@@ -1,6 +1,6 @@
'use client'
import { useEffect, useState } from 'react'
import { useEffect } from 'react'
import '../Installs.css'
import { invoke } from '@tauri-apps/api/core'
import { useGlobal } from '../GlobalProvider'
@@ -22,7 +22,9 @@ export default function Installs () {
getVersionInfo,
getGameInfo,
setSelectedGame,
serverVersionList
serverVersionList,
category,
setCategory
} = useGlobal()
const params = useSearchParams()
@@ -30,9 +32,6 @@ export default function Installs () {
const id = Number(params.get('id') || 0)
const game = serverVersionList?.games.find(g => g.id === id)
const [category, setCategory] = useState<number>(-1)
const [lastId, setLastId] = useState(id)
useEffect(() => {
if (!showPopup) return
setSelectedVersionList([])
@@ -40,11 +39,6 @@ export default function Installs () {
if (!id || !game) return <p>Invalid game</p>
if (lastId !== id) {
setLastId(id)
setCategory(-1)
}
const needsRevisionUpdate = (
lastRevision: number | undefined,
version: string