Settings, queue fixes, and more

This commit is contained in:
2025-07-22 17:22:05 -07:00
parent 7077bf6bea
commit c507a6fbe4
11 changed files with 242 additions and 22 deletions

View File

@@ -2,15 +2,31 @@ import { useEffect } from 'react'
import axios from 'axios'
import { InstallsProps } from '../types/InstallsProps'
import { platform } from '@tauri-apps/plugin-os'
import { readNormalConfig } from '../util/BazookaManager'
export default function Installs({ downloadProgress, showPopup, setShowPopup, setPopupMode, setFadeOut, setSelectedVersionList, setVersionList }: InstallsProps) {
useEffect(() => {
if (!showPopup) return
setSelectedVersionList([]);
setSelectedVersionList([])
setVersionList(null)
axios.get('https://berrydash.lncvrt.xyz/database/launcher/versions.php')
.then(res => setVersionList(res.data.filter((d: { platforms: string[] }) => d.platforms.includes(platform()))))
.catch(() => setVersionList([]))
;(async () => {
try {
const config = await readNormalConfig()
const useWine = config.settings.useWineOnUnixWhenNeeded
const res = await axios.get('https://berrydash.lncvrt.xyz/database/launcher/versions.php')
const p = platform()
const filtered = res.data.filter((d: { platforms: string[] }) =>
p === 'macos' || p === 'linux'
? useWine
? d.platforms.includes('windows') || d.platforms.includes(p)
: d.platforms.includes(p)
: d.platforms.includes(p)
)
setVersionList(filtered)
} catch {
setVersionList([])
}
})()
}, [showPopup])
return (