mirror of
https://github.com/monkeytypegame/monkeytype.git
synced 2025-11-17 14:19:40 +08:00
changed banner message when using localhost
This commit is contained in:
parent
db9dcafc25
commit
4eec1db25f
1 changed files with 18 additions and 8 deletions
|
|
@ -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(
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue