From 4eec1db25ff65f84f21e02e8a53f8b9e5f5c826a Mon Sep 17 00:00:00 2001 From: Miodec Date: Tue, 21 Jun 2022 12:09:23 +0200 Subject: [PATCH] changed banner message when using localhost --- frontend/src/ts/elements/psa.ts | 26 ++++++++++++++++++-------- 1 file changed, 18 insertions(+), 8 deletions(-) diff --git a/frontend/src/ts/elements/psa.ts b/frontend/src/ts/elements/psa.ts index 21c3a638d..91ae9f433 100644 --- a/frontend/src/ts/elements/psa.ts +++ b/frontend/src/ts/elements/psa.ts @@ -20,14 +20,24 @@ function setMemory(id: string): void { async function getLatest(): Promise { const response = await Ape.psas.get(); 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, - undefined, - true - ); + if (window.location.hostname === "localhost") { + Notifications.addBanner( + "Dev Info: Backend server not running", + 0, + "exclamation-triangle", + false + ); + } else { + 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, + undefined, + true + ); + } + return []; } else if (response.status === 503) { Notifications.addBanner(