make validation message infinite (#6318)

This commit is contained in:
Dinh Long Nguyen 2025-08-28 13:47:46 +07:00 committed by GitHub
parent 8166f3a32f
commit eab4b277a2
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -178,7 +178,7 @@ export function DownloadManagement() {
description: t('common:toast.modelValidationStarted.description', { description: t('common:toast.modelValidationStarted.description', {
modelId: event.modelId, modelId: event.modelId,
}), }),
duration: 10000, duration: Infinity,
}) })
}, },
[t] [t]
@ -199,7 +199,7 @@ export function DownloadManagement() {
description: t('common:toast.modelValidationFailed.description', { description: t('common:toast.modelValidationFailed.description', {
modelId: event.modelId, modelId: event.modelId,
}), }),
duration: 30000, // Requires manual dismissal for security-critical message duration: 30000,
}) })
}, },
[removeDownload, removeLocalDownloadingModel, t] [removeDownload, removeLocalDownloadingModel, t]
@ -244,9 +244,12 @@ export function DownloadManagement() {
removeLocalDownloadingModel(state.modelId) removeLocalDownloadingModel(state.modelId)
toast.success(t('common:toast.downloadAndVerificationComplete.title'), { toast.success(t('common:toast.downloadAndVerificationComplete.title'), {
id: 'download-complete', id: 'download-complete',
description: t('common:toast.downloadAndVerificationComplete.description', { description: t(
item: state.modelId, 'common:toast.downloadAndVerificationComplete.description',
}), {
item: state.modelId,
}
),
}) })
}, },
[removeDownload, removeLocalDownloadingModel, t] [removeDownload, removeLocalDownloadingModel, t]
@ -260,7 +263,10 @@ export function DownloadManagement() {
events.on(DownloadEvent.onFileDownloadStopped, onFileDownloadStopped) events.on(DownloadEvent.onFileDownloadStopped, onFileDownloadStopped)
events.on(DownloadEvent.onModelValidationStarted, onModelValidationStarted) events.on(DownloadEvent.onModelValidationStarted, onModelValidationStarted)
events.on(DownloadEvent.onModelValidationFailed, onModelValidationFailed) events.on(DownloadEvent.onModelValidationFailed, onModelValidationFailed)
events.on(DownloadEvent.onFileDownloadAndVerificationSuccess, onFileDownloadAndVerificationSuccess) events.on(
DownloadEvent.onFileDownloadAndVerificationSuccess,
onFileDownloadAndVerificationSuccess
)
// Register app update event listeners // Register app update event listeners
events.on(AppEvent.onAppUpdateDownloadUpdate, onAppUpdateDownloadUpdate) events.on(AppEvent.onAppUpdateDownloadUpdate, onAppUpdateDownloadUpdate)
@ -278,7 +284,10 @@ export function DownloadManagement() {
onModelValidationStarted onModelValidationStarted
) )
events.off(DownloadEvent.onModelValidationFailed, onModelValidationFailed) events.off(DownloadEvent.onModelValidationFailed, onModelValidationFailed)
events.off(DownloadEvent.onFileDownloadAndVerificationSuccess, onFileDownloadAndVerificationSuccess) events.off(
DownloadEvent.onFileDownloadAndVerificationSuccess,
onFileDownloadAndVerificationSuccess
)
// Unregister app update event listeners // Unregister app update event listeners
events.off(AppEvent.onAppUpdateDownloadUpdate, onAppUpdateDownloadUpdate) events.off(AppEvent.onAppUpdateDownloadUpdate, onAppUpdateDownloadUpdate)