From 489fd1b5fdbcb7e5fb7312b23c9da43c37b36277 Mon Sep 17 00:00:00 2001 From: sethburkart123 Date: Wed, 19 Jun 2024 17:39:52 +1000 Subject: [PATCH] fix: notices not working in many cases --- src/SEQTA.ts | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/SEQTA.ts b/src/SEQTA.ts index 13a4224e..4920b93f 100644 --- a/src/SEQTA.ts +++ b/src/SEQTA.ts @@ -2121,7 +2121,8 @@ export async function loadHomePage() { }) const response = await GetPrefs.json() - const labelArray = response.payload[3].value.split(' ') + + const labelArray = response.payload.filter((item: any) => item.name === 'notices.filters').map((item: any) => item.value)[0].split(' ') const xhr2 = new XMLHttpRequest() xhr2.open( @@ -2147,6 +2148,7 @@ export async function loadHomePage() { } else { if (!NoticeContainer!.innerText) { for (let i = 0; i < NoticesPayload.payload.length; i++) { + console.log(NoticesPayload.payload[i].title, labelArray.includes(JSON.stringify(NoticesPayload.payload[i].label))) if (labelArray.includes(JSON.stringify(NoticesPayload.payload[i].label))) { // Create a div, and place information from json response const NewNotice = document.createElement('div')