changed banner message when using localhost

This commit is contained in:
Miodec 2022-06-21 12:09:23 +02:00
parent db9dcafc25
commit 4eec1db25f

View file

@ -20,14 +20,24 @@ function setMemory(id: string): void {
async function getLatest(): Promise<MonkeyTypes.PSA[]> {
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. <a target= '_blank' href='https://monkeytype.instatus.com/'>Check the status page</a> or <a target= '_blank' href='https://twitter.com/monkeytypegame'>Twitter</a> 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. <a target= '_blank' href='https://monkeytype.instatus.com/'>Check the status page</a> or <a target= '_blank' href='https://twitter.com/monkeytypegame'>Twitter</a> for more information.",
-1,
"exclamation-triangle",
true,
undefined,
true
);
}
return [];
} else if (response.status === 503) {
Notifications.addBanner(