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.

feat: dismiss validation model toast first before showing download complete toast

Vanalite05a611a6016a
diff --git a/web-app/src/containers/DownloadManegement.tsx b/web-app/src/containers/DownloadManegement.tsx
index e0d829740..ab8bc2743 100644
--- a/web-app/src/containers/DownloadManegement.tsx
+++ b/web-app/src/containers/DownloadManegement.tsx
@@ -224,12 +224,15 @@ export function DownloadManagement() {
removeDownload(state.modelId)
removeLocalDownloadingModel(state.modelId)
- toast.success(t('common:toast.downloadComplete.title'), {
- id: 'download-complete',
- description: t('common:toast.downloadComplete.description', {
- item: state.modelId,
- }),
- })
+
+ setTimeout(() => {
+ toast.success(t('common:toast.downloadComplete.title'), {
+ id: `download-complete-${state.modelId}`,
+ description: t('common:toast.downloadComplete.description', {
+ item: state.modelId,
+ }),
+ })
+ }, 100)
},
[removeDownload, removeLocalDownloadingModel, t]
)
@@ -243,15 +246,18 @@ export function DownloadManagement() {
removeDownload(state.modelId)
removeLocalDownloadingModel(state.modelId)
- toast.success(t('common:toast.downloadAndVerificationComplete.title'), {
- id: 'download-complete',
- description: t(
- 'common:toast.downloadAndVerificationComplete.description',
- {
- item: state.modelId,
- }
- ),
- })
+
+ setTimeout(() => {
+ toast.success(t('common:toast.downloadAndVerificationComplete.title'), {
+ id: `download-complete-${state.modelId}`,
+ description: t(
+ 'common:toast.downloadAndVerificationComplete.description',
+ {
+ item: state.modelId,
+ }
+ ),
+ })
+ }, 100)
},
[removeDownload, removeLocalDownloadingModel, t]
)