mirror of
https://github.com/BetterSEQTA/BetterSEQTA-Plus.git
synced 2026-06-06 03:34:40 +00:00
fix: assessments not loading after notices error #150
This commit is contained in:
+28
-25
@@ -2195,7 +2195,7 @@ export async function loadHomePage() {
|
|||||||
|
|
||||||
var Notices = stringToHTML(NoticesStr)
|
var Notices = stringToHTML(NoticesStr)
|
||||||
// Appends the shortcut container into the home container
|
// Appends the shortcut container into the home container
|
||||||
document.getElementById('home-container')!.append(Notices.firstChild!)
|
document.getElementById('home-container')!.append(Notices.firstChild!) // HERE!!!
|
||||||
|
|
||||||
if (settingsState.animations) {
|
if (settingsState.animations) {
|
||||||
animate(
|
animate(
|
||||||
@@ -2219,38 +2219,41 @@ export async function loadHomePage() {
|
|||||||
|
|
||||||
const response = await GetPrefs.json()
|
const response = await GetPrefs.json()
|
||||||
|
|
||||||
const labelArray = response.payload.filter((item: any) => item.name === 'notices.filters').map((item: any) => item.value)[0].split(' ')
|
const labelArray = response.payload.filter((item: any) => item.name === 'notices.filters').map((item: any) => item.value)
|
||||||
|
|
||||||
const xhr2 = new XMLHttpRequest()
|
if (labelArray.length !== 0) {
|
||||||
xhr2.open(
|
const labelArray = response.payload.filter((item: any) => item.name === 'notices.filters').map((item: any) => item.value)[0].split(' ')
|
||||||
'POST',
|
const xhr2 = new XMLHttpRequest()
|
||||||
`${location.origin}/seqta/student/load/notices?`,
|
xhr2.open(
|
||||||
true
|
'POST',
|
||||||
)
|
`${location.origin}/seqta/student/load/notices?`,
|
||||||
xhr2.setRequestHeader('Content-Type', 'application/json; charset=utf-8')
|
true
|
||||||
|
)
|
||||||
xhr2.onreadystatechange = function () {
|
xhr2.setRequestHeader('Content-Type', 'application/json; charset=utf-8')
|
||||||
if (xhr2.readyState === 4) {
|
|
||||||
processNotices(xhr2.response, labelArray);
|
|
||||||
}
|
|
||||||
};
|
|
||||||
|
|
||||||
const dateControl = document.querySelector('input[type="date"]') as HTMLInputElement;
|
|
||||||
xhr2.send(JSON.stringify({ date: dateControl.value }));
|
|
||||||
|
|
||||||
function onInputChange(e: any) {
|
|
||||||
xhr2.open('POST', `${location.origin}/seqta/student/load/notices?`, true);
|
|
||||||
xhr2.setRequestHeader('Content-Type', 'application/json; charset=utf-8');
|
|
||||||
xhr2.send(JSON.stringify({ date: e.target.value }));
|
|
||||||
|
|
||||||
xhr2.onreadystatechange = function () {
|
xhr2.onreadystatechange = function () {
|
||||||
if (xhr2.readyState === 4) {
|
if (xhr2.readyState === 4) {
|
||||||
processNotices(xhr2.response, labelArray);
|
processNotices(xhr2.response, labelArray);
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
}
|
|
||||||
|
|
||||||
dateControl.addEventListener('input', onInputChange);
|
const dateControl = document.querySelector('input[type="date"]') as HTMLInputElement;
|
||||||
|
xhr2.send(JSON.stringify({ date: dateControl.value }));
|
||||||
|
|
||||||
|
function onInputChange(e: any) {
|
||||||
|
xhr2.open('POST', `${location.origin}/seqta/student/load/notices?`, true);
|
||||||
|
xhr2.setRequestHeader('Content-Type', 'application/json; charset=utf-8');
|
||||||
|
xhr2.send(JSON.stringify({ date: e.target.value }));
|
||||||
|
|
||||||
|
xhr2.onreadystatechange = function () {
|
||||||
|
if (xhr2.readyState === 4) {
|
||||||
|
processNotices(xhr2.response, labelArray);
|
||||||
|
}
|
||||||
|
};
|
||||||
|
}
|
||||||
|
|
||||||
|
dateControl.addEventListener('input', onInputChange);
|
||||||
|
}
|
||||||
|
|
||||||
if (settingsState.notificationcollector) {
|
if (settingsState.notificationcollector) {
|
||||||
enableNotificationCollector()
|
enableNotificationCollector()
|
||||||
|
|||||||
Reference in New Issue
Block a user