mirror of
https://github.com/coaidev/coai.git
synced 2025-05-30 18:30:32 +09:00
update update successful toast
This commit is contained in:
parent
af2e1ef3d7
commit
c9aa30b160
@ -22,6 +22,17 @@ function ReloadPrompt() {
|
||||
},
|
||||
});
|
||||
|
||||
const before = localStorage.getItem('version') || '';
|
||||
if (before.length > 0 && before !== version) {
|
||||
toast({
|
||||
title: t('service.update-success'),
|
||||
description: t('service.update-success-prompt'),
|
||||
})
|
||||
console.debug(`[service] service worker updated (from ${before} to ${version})`);
|
||||
}
|
||||
localStorage.setItem('version', version);
|
||||
|
||||
|
||||
useEffect(() => {
|
||||
if (offlineReady) {
|
||||
toast({
|
||||
@ -44,7 +55,7 @@ function ReloadPrompt() {
|
||||
setOfflineReady(false);
|
||||
setNeedRefresh(false);
|
||||
}
|
||||
}, []);
|
||||
}, [offlineReady, needRefresh]);
|
||||
|
||||
return <></>;
|
||||
}
|
||||
|
@ -1,6 +1,6 @@
|
||||
import axios from "axios";
|
||||
|
||||
export const version: string = "3.2.3";
|
||||
export const version = "3.2.4";
|
||||
export const deploy: boolean = true;
|
||||
export let rest_api: string = "http://localhost:8094";
|
||||
export let ws_api: string = "ws://localhost:8094";
|
||||
|
@ -168,6 +168,8 @@ const resources = {
|
||||
"update": "Update",
|
||||
"offline-title": "Offline Mode",
|
||||
"offline": "App is currently offline.",
|
||||
"update-success": "Update Success",
|
||||
"update-success-prompt": "You have been updated to the latest version.",
|
||||
}
|
||||
},
|
||||
},
|
||||
@ -323,6 +325,8 @@ const resources = {
|
||||
"update": "更新",
|
||||
"offline-title": "离线模式",
|
||||
"offline": "应用当前处于离线状态。",
|
||||
"update-success": "更新成功",
|
||||
"update-success-prompt": "您已更新至最新版本。",
|
||||
}
|
||||
},
|
||||
},
|
||||
@ -489,6 +493,8 @@ const resources = {
|
||||
"update": "Обновить",
|
||||
"offline-title": "Режим оффлайн",
|
||||
"offline": "Приложение в настоящее время находится в автономном режиме.",
|
||||
"update-success": "Обновление успешно",
|
||||
"update-success-prompt": "Вы обновились до последней версии.",
|
||||
}
|
||||
},
|
||||
},
|
||||
|
Loading…
Reference in New Issue
Block a user