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 () {
|
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
|
||||||
|
|||||||
@@ -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}
|
||||||
selectedVersionList.length
|
title={
|
||||||
} version${
|
downloadProgress.length != 0
|
||||||
selectedVersionList.length == 1 ? '' : 's'
|
? "You cannot download the versions as you have another download that hasn't completed."
|
||||||
} of ${getVersionGame(selectedGame)?.name}`}
|
: `Click to download ${
|
||||||
|
selectedVersionList.length
|
||||||
|
} version${
|
||||||
|
selectedVersionList.length == 1 ? '' : 's'
|
||||||
|
} of ${getVersionGame(selectedGame)?.name}`
|
||||||
|
}
|
||||||
>
|
>
|
||||||
Download {selectedVersionList.length} version
|
Download {selectedVersionList.length} version
|
||||||
{selectedVersionList.length == 1 ? '' : 's'}
|
{selectedVersionList.length == 1 ? '' : 's'}
|
||||||
|
|||||||
@@ -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
|
||||||
|
|||||||
Reference in New Issue
Block a user