diff --git a/package.json b/package.json index ea36f0d1..1ca7e66d 100644 --- a/package.json +++ b/package.json @@ -51,7 +51,7 @@ "@types/webextension-polyfill": "^0.10.7", "autoprefixer": "^10.4.15", "color": "^4.2.3", - "dompurify": "^3.0.6", + "dompurify": "^3.0.8", "framer-motion": "^10.16.16", "install": "^0.13.0", "localforage": "^1.10.0", diff --git a/src/SEQTA.ts b/src/SEQTA.ts index e2e546ca..4b6d59dd 100644 --- a/src/SEQTA.ts +++ b/src/SEQTA.ts @@ -1578,6 +1578,8 @@ function CheckUnmarkedAttendance(lessonattendance: any) { } function callHomeTimetable(date: string, change?: any) { + const DayContainer = document.getElementById('day-container')! + console.log("Daycontainer: ", DayContainer) // Creates a HTTP Post Request to the SEQTA page for the students timetable var xhr = new XMLHttpRequest() xhr.open('POST', `${location.origin}/seqta/student/load/timetable?`, true) @@ -1652,10 +1654,6 @@ function callHomeTimetable(date: string, change?: any) { }) } } else { - if (DayContainer == null) { - console.log('DayContainer is null') - //DayContainer = document.getElementById('day-container')! - } console.log(DayContainer); DayContainer.innerHTML = '' var dummyDay = document.createElement('div') @@ -2187,9 +2185,15 @@ function AddCustomShortcutsToPage() { async function loadHomePage() { // Sends the html data for the home page console.log('[BetterSEQTA] Started Loading Home Page') + document.title = 'Home ― SEQTA Learn' const element = document.querySelector('[data-key=home]') + await new Promise((resolve) => { + // Delay to prevent SEQTA from removing the UI elements + setTimeout(resolve, 8) + }) + // Apply the active class to indicate clicked on home button element!.classList.add('active') @@ -2201,34 +2205,33 @@ async function loadHomePage() { return } - main.innerHTML = ''; - const icon = document.querySelector('link[rel*="icon"]')! as HTMLLinkElement icon.href = icon48 currentSelectedDate = new Date() // Creates the root of the home page added to the main div - var html = stringToHTML('