Make it so you can select versions to download while another version is being downloaded
This commit is contained in:
@@ -10,7 +10,6 @@ import { platform } from '@tauri-apps/plugin-os'
|
||||
|
||||
export default function Installs () {
|
||||
const {
|
||||
downloadProgress,
|
||||
showPopup,
|
||||
setShowPopup,
|
||||
setPopupMode,
|
||||
@@ -44,7 +43,6 @@ export default function Installs () {
|
||||
setShowPopup(true)
|
||||
setFadeOut(false)
|
||||
}}
|
||||
disabled={downloadProgress.length != 0}
|
||||
title='Click to download more versions of this game.'
|
||||
>
|
||||
Download versions
|
||||
|
||||
@@ -225,6 +225,9 @@ export default function RootLayout ({
|
||||
.filter(v => !downloadedVersionsConfig?.list.includes(v.id))
|
||||
.filter(v => {
|
||||
if (game && v.game != game) return false
|
||||
if (downloadProgress.length != 0) {
|
||||
return !downloadProgress.some(d => d.version === v.id)
|
||||
}
|
||||
return true
|
||||
})
|
||||
.sort((a, b) => {
|
||||
@@ -800,11 +803,16 @@ export default function RootLayout ({
|
||||
setTimeout(() => setShowPopup(false), 200)
|
||||
downloadVersions()
|
||||
}}
|
||||
title={`Click to download ${
|
||||
selectedVersionList.length
|
||||
} version${
|
||||
selectedVersionList.length == 1 ? '' : 's'
|
||||
} of ${getVersionGame(selectedGame)?.name}`}
|
||||
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
|
||||
} version${
|
||||
selectedVersionList.length == 1 ? '' : 's'
|
||||
} of ${getVersionGame(selectedGame)?.name}`
|
||||
}
|
||||
>
|
||||
Download {selectedVersionList.length} version
|
||||
{selectedVersionList.length == 1 ? '' : 's'}
|
||||
|
||||
@@ -15,7 +15,6 @@ import { useRouter } from 'next/navigation'
|
||||
|
||||
export default function Installs () {
|
||||
const {
|
||||
downloadProgress,
|
||||
showPopup,
|
||||
setShowPopup,
|
||||
setPopupMode,
|
||||
@@ -48,7 +47,6 @@ export default function Installs () {
|
||||
setShowPopup(true)
|
||||
setFadeOut(false)
|
||||
}}
|
||||
disabled={downloadProgress.length != 0}
|
||||
title='Click to download more games.'
|
||||
>
|
||||
Download game
|
||||
|
||||
Reference in New Issue
Block a user