mirror of
https://github.com/monkeytypegame/monkeytype.git
synced 2025-02-26 07:44:01 +08:00
added psa request failed notification (#3155)
* added psa request failed notification * fixed prettier issues
This commit is contained in:
parent
709d141aa6
commit
bc58cbf613
1 changed files with 9 additions and 1 deletions
|
@ -19,7 +19,15 @@ function setMemory(id: string): void {
|
|||
|
||||
async function getLatest(): Promise<MonkeyTypes.PSA[]> {
|
||||
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. <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
|
||||
);
|
||||
return [];
|
||||
} else if (response.status === 503) {
|
||||
Notifications.addBanner(
|
||||
"Server is currently under maintenance. <a target= '_blank' href='https://monkeytype.instatus.com/'>Check the status page</a> for more info.",
|
||||
-1,
|
||||
|
|
Loading…
Reference in a new issue