chore: update alerts to use new health service

This commit is contained in:
Paul Makles
2023-07-06 19:00:30 +01:00
parent 9d83d7cc1c
commit 0d5ffb4df8
3 changed files with 38 additions and 9 deletions

View File

@@ -78,7 +78,7 @@ export function useSystemAlert() {
*/
async function checkVersion() {
const { version, poll_rate, alert } = (await fetch(
"https://api.revolt.chat/release",
"https://health.revolt.chat/api/health",
).then((res) => res.json())) as {
version: string;
poll_rate?: number;
@@ -111,7 +111,10 @@ async function checkVersion() {
}
}
if (import.meta.env.VITE_API_URL === "https://api.revolt.chat") {
if (
import.meta.env.VITE_API_URL === "https://api.revolt.chat" ||
import.meta.env.VITE_API_URL === "https://app.revolt.chat/api"
) {
// Check for critical updates hourly
schedule();
checkVersion();