diff --git a/frontend/src/_locales/zh-hans/main.json b/frontend/src/_locales/zh-hans/main.json index 4a9c33e..2af1d89 100644 --- a/frontend/src/_locales/zh-hans/main.json +++ b/frontend/src/_locales/zh-hans/main.json @@ -101,5 +101,6 @@ "Use Custom CUDA kernel to Accelerate": "使用自定义CUDA算子加速", "Enabling this option can greatly improve inference speed, but there may be compatibility issues. If it fails to start, please turn off this option.": "开启这个选项能大大提升推理速度,但可能存在兼容性问题,如果启动失败,请关闭此选项", "Supported custom cuda file not found": "没有找到支持的自定义cuda文件", - "Failed to copy custom cuda file": "自定义cuda文件复制失败" + "Failed to copy custom cuda file": "自定义cuda文件复制失败", + "Downloading update, please wait. If it is not completed, please manually download the program from GitHub and replace the original program.": "正在下载更新,请等待。如果一直未完成,请从Github手动下载并覆盖原程序" } \ No newline at end of file diff --git a/frontend/src/utils/index.tsx b/frontend/src/utils/index.tsx index 6bcb856..0a33837 100644 --- a/frontend/src/utils/index.tsx +++ b/frontend/src/utils/index.tsx @@ -225,6 +225,11 @@ export async function checkUpdate(notifyEvenLatest: boolean = false) { `https://gitee.com/josc146/RWKV-Runner/releases/download/${versionTag}/RWKV-Runner_windows_x64.exe`; toastWithButton(t('New Version Available') + ': ' + versionTag, t('Update'), () => { deleteDynamicProgramFiles(); + toast(t('Downloading update, please wait. If it is not completed, please manually download the program from GitHub and replace the original program.'), { + type: 'info', + position: 'bottom-left', + autoClose: 6000 + }); setTimeout(() => { UpdateApp(updateUrl).catch((e) => { toast(t('Update Error, Please restart this program') + ' - ' + e.message || e, { @@ -258,15 +263,23 @@ export async function checkUpdate(notifyEvenLatest: boolean = false) { } export function toastWithButton(text: string, buttonText: string, onClickButton: () => void, options?: ToastOptions) { - return toast( + let triggered = false; + const id = toast(
{text}
- +
, { type: 'info', ...options }); + return id; } export function getSupportedCustomCudaFile() {