Skip to content

armgit / jan

Public Imported from GitHub
0

Jan is an open source alternative to ChatGPT that runs 100% offline on your computer.

fix: show error toast on download error

Chaiyapruek Muangsiri38c5911460d8
diff --git a/web-app/src/containers/DownloadManegement.tsx b/web-app/src/containers/DownloadManegement.tsx
index 77b03aedf..72feaaf22 100644
--- a/web-app/src/containers/DownloadManegement.tsx
+++ b/web-app/src/containers/DownloadManegement.tsx
@@ -161,8 +161,14 @@ export function DownloadManagement() {
console.debug('onFileDownloadError', state)
removeDownload(state.modelId)
removeLocalDownloadingModel(state.modelId)
+ toast.error(t('common:toast.downloadFailed.title'), {
+ id: 'download-failed',
+ description: t('common:toast.downloadFailed.description', {
+ item: state.modelId,
+ }),
+ })
},
- [removeDownload, removeLocalDownloadingModel]
+ [removeDownload, removeLocalDownloadingModel, t]
)
const onFileDownloadStopped = useCallback(
diff --git a/web-app/src/locales/en/common.json b/web-app/src/locales/en/common.json
index 6ab02fbfd..4eaf498c5 100644
--- a/web-app/src/locales/en/common.json
+++ b/web-app/src/locales/en/common.json
@@ -257,6 +257,10 @@
"downloadCancelled": {
"title": "Download Cancelled",
"description": "The download process was cancelled"
+ },
+ "downloadFailed": {
+ "title": "Download Failed",
+ "description": "{{item}} download failed"
}
}
-}
+}
\ No newline at end of file