From bc58cbf61311857cd3b56ae34c949bd1fc073278 Mon Sep 17 00:00:00 2001 From: smunky <105208736+devkennyy@users.noreply.github.com> Date: Mon, 20 Jun 2022 09:19:08 +1000 Subject: [PATCH] added psa request failed notification (#3155) * added psa request failed notification * fixed prettier issues --- frontend/src/ts/elements/psa.ts | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/frontend/src/ts/elements/psa.ts b/frontend/src/ts/elements/psa.ts index 25ebb162f..1bfc82bba 100644 --- a/frontend/src/ts/elements/psa.ts +++ b/frontend/src/ts/elements/psa.ts @@ -19,7 +19,15 @@ function setMemory(id: string): void { async function getLatest(): Promise { const response = await Ape.psas.get(); - if (response.message === "Server is down for maintenance") { + if (response.status === 500) { + Notifications.addBanner( + "PSA request failed. If this issue persists the server might be experiencing unexpected down time. Check the status page or Twitter for more information.", + -1, + "exclamation-triangle", + true + ); + return []; + } else if (response.status === 503) { Notifications.addBanner( "Server is currently under maintenance. Check the status page for more info.", -1,