Skip to content

Commit

Permalink
feat: enable test alerts display in test mode
Browse files Browse the repository at this point in the history
  • Loading branch information
Ahmedhossamdev committed Nov 13, 2024
1 parent 1231c37 commit ee2949e
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions src/routes/api/oba/alerts/+server.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ export async function GET() {
'alerts.pb',
PRIVATE_OBACO_SHOW_TEST_ALERTS && PRIVATE_OBACO_SHOW_TEST_ALERTS == 'true' ? { test: 1 } : {}
);

const response = await fetch(alertsURL);

const buffer = await response.arrayBuffer();
Expand All @@ -17,6 +18,12 @@ export async function GET() {

let validAlert = null;
for (const entity of feed.entity) {

// If we're in test mode, show the alert to test the UI
if (PRIVATE_OBACO_SHOW_TEST_ALERTS) {
validAlert = entity.alert;
break;
}
if (entity.alert && isValidAlert(entity.alert)) {
validAlert = entity.alert;
break;
Expand Down

0 comments on commit ee2949e

Please sign in to comment.