From 8dce406786a32f33f4b526221685f7dc46fe2a7b Mon Sep 17 00:00:00 2001 From: Miodec Date: Tue, 22 Feb 2022 21:31:52 +0100 Subject: [PATCH] showing banner if server under maintenance closes #2569 --- frontend/src/scripts/elements/psa.ts | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/frontend/src/scripts/elements/psa.ts b/frontend/src/scripts/elements/psa.ts index e4f1526a7..b5ce6509d 100644 --- a/frontend/src/scripts/elements/psa.ts +++ b/frontend/src/scripts/elements/psa.ts @@ -17,6 +17,15 @@ function setMemory(id: string): void { async function getLatest(): Promise { const response = await Ape.psas.get(); + if (response.message === "Server is down for maintenance") { + Notifications.addBanner( + "Server is currently under maintenance", + -1, + "bullhorn", + true + ); + return []; + } return response.data as MonkeyTypes.PSA[]; }