Skip to content

Commit

Permalink
fix: Try to log the failed install mods
Browse files Browse the repository at this point in the history
  • Loading branch information
ci010 committed Jun 4, 2023
1 parent 30db47b commit eda3e1c
Showing 1 changed file with 14 additions and 0 deletions.
14 changes: 14 additions & 0 deletions xmcl-keystone-ui/src/composables/installList.ts
Original file line number Diff line number Diff line change
Expand Up @@ -410,25 +410,35 @@ export function useInstallList() {

try {
installing.value = true
console.log(toInstallCurseforge)
console.log(toInstallModrinth)
await Promise.all([
install({ mods: toInstall }).then(() => {
successedToInstall.push(...toInstall)
}, (e) => {
console.error('Fail to install', e)
}),
uninstall({ mods: toRemove }).then(() => {
successedToRemove.push(...toRemove)
}, (e) => {
console.error('Fail to uninstall', e)
}),
...toInstallCurseforge.map(([file, icon]) => installFile({
file,
icon,
type: 'mc-mods',
}).then(() => {
successedToInstallCurseforge.push(file)
}, (e) => {
console.error('Fail to install curseforge', e)
})),
...toInstallModrinth.map(([version, icon]) => installVersion({
version,
icon,
}).then(() => {
successedToInstallModrinth.push(version)
}, (e) => {
console.error('Fail to install modrinth', e)
})),
])
} finally {
Expand All @@ -444,6 +454,10 @@ export function useInstallList() {
return true
})

if (list.value.length > 0) {
console.error(`Failed to install ${list.value.length} mods.`)
}

for (const key in mutexDict) {
mutexDict[key] = []
}
Expand Down

0 comments on commit eda3e1c

Please sign in to comment.