fix: wrong condition for displaying error message (#1376)

This commit is contained in:
Louis 2024-01-05 13:20:41 +07:00 committed by GitHub
parent f29739c133
commit cebb6738c3
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -36,13 +36,14 @@ const setDownloadStateFailedAtom = atom(
const state = currentState[modelId] const state = currentState[modelId]
if (!state) { if (!state) {
console.debug(`Cannot find download state for ${modelId}`) console.debug(`Cannot find download state for ${modelId}`)
toaster({
title: 'Download Failed',
description: `Model ${modelId} download failed: ${error}`,
type: 'error',
})
return return
} }
toaster({
title: 'Download Failed',
description: `Model ${modelId} download failed: ${error}`,
type: 'error',
})
delete currentState[modelId] delete currentState[modelId]
set(modelDownloadStateAtom, currentState) set(modelDownloadStateAtom, currentState)
} }