Make it so you can select versions to download while another version is being downloaded

This commit is contained in:
2025-12-27 20:38:25 -07:00
parent 1e93ef4d07
commit 6ec7e8df82
3 changed files with 13 additions and 9 deletions

View File

@@ -10,7 +10,6 @@ import { platform } from '@tauri-apps/plugin-os'
export default function Installs () { export default function Installs () {
const { const {
downloadProgress,
showPopup, showPopup,
setShowPopup, setShowPopup,
setPopupMode, setPopupMode,
@@ -44,7 +43,6 @@ export default function Installs () {
setShowPopup(true) setShowPopup(true)
setFadeOut(false) setFadeOut(false)
}} }}
disabled={downloadProgress.length != 0}
title='Click to download more versions of this game.' title='Click to download more versions of this game.'
> >
Download versions Download versions

View File

@@ -225,6 +225,9 @@ export default function RootLayout ({
.filter(v => !downloadedVersionsConfig?.list.includes(v.id)) .filter(v => !downloadedVersionsConfig?.list.includes(v.id))
.filter(v => { .filter(v => {
if (game && v.game != game) return false if (game && v.game != game) return false
if (downloadProgress.length != 0) {
return !downloadProgress.some(d => d.version === v.id)
}
return true return true
}) })
.sort((a, b) => { .sort((a, b) => {
@@ -800,11 +803,16 @@ export default function RootLayout ({
setTimeout(() => setShowPopup(false), 200) setTimeout(() => setShowPopup(false), 200)
downloadVersions() downloadVersions()
}} }}
title={`Click to download ${ disabled={downloadProgress.length != 0}
title={
downloadProgress.length != 0
? "You cannot download the versions as you have another download that hasn't completed."
: `Click to download ${
selectedVersionList.length selectedVersionList.length
} version${ } version${
selectedVersionList.length == 1 ? '' : 's' selectedVersionList.length == 1 ? '' : 's'
} of ${getVersionGame(selectedGame)?.name}`} } of ${getVersionGame(selectedGame)?.name}`
}
> >
Download {selectedVersionList.length} version Download {selectedVersionList.length} version
{selectedVersionList.length == 1 ? '' : 's'} {selectedVersionList.length == 1 ? '' : 's'}

View File

@@ -15,7 +15,6 @@ import { useRouter } from 'next/navigation'
export default function Installs () { export default function Installs () {
const { const {
downloadProgress,
showPopup, showPopup,
setShowPopup, setShowPopup,
setPopupMode, setPopupMode,
@@ -48,7 +47,6 @@ export default function Installs () {
setShowPopup(true) setShowPopup(true)
setFadeOut(false) setFadeOut(false)
}} }}
disabled={downloadProgress.length != 0}
title='Click to download more games.' title='Click to download more games.'
> >
Download game Download game