Fix downloads

This commit is contained in:
Lncvrt committed 2026-03-24 19:55:00 -07:00
1 parent 3ee371998a
commit 5206a7f25d
1 file changed
+17 -3
+17 -3
View File
@@ -58,18 +58,31 @@ export default function DownloadsPopup () {
const res = await invoke<string>('download', {
url: v.url,
name: v.version,
executable: v.executable,
hash: v.hash
hash: v.hash,
downloadType: v.type,
modId: String(v.modId ?? '')
})
if (res === '1') {
setDownloadProgress(prev =>
prev.filter(d => d.version !== v.version)
)
if (v.type != 1) {
setDownloadedVersionsConfig(prev => {
if (!prev) return prev
const updated = {
const updated =
v.type == 2
? {
...prev,
mods: {
...prev.mods,
[v.modGame! + '-' + v.modId!]: {
[v.modVersion!]: Date.now()
}
}
}
: {
...prev,
list: {
...prev.list,
@@ -80,6 +93,7 @@ export default function DownloadsPopup () {
writeVersionsConfig(updated)
return updated
})
}
} else if (res == '0') {
setDownloadProgress(prev => {
const i = prev.findIndex(d => d.version === v.version)