mirror of
https://github.com/BetterSEQTA/BetterSEQTA-Plus.git
synced 2026-06-05 19:24:39 +00:00
feat(engage): fix loading screen hang and handle login/logout flow
Made-with: Cursor
This commit is contained in:
+26
-15
@@ -480,24 +480,35 @@ function CheckNoticeTextColour(notice: any) {
|
|||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function watchForEngageLogin() {
|
||||||
|
const observer = new MutationObserver(() => {
|
||||||
|
if (!document.querySelector(".login")) {
|
||||||
|
observer.disconnect();
|
||||||
|
location.reload();
|
||||||
|
}
|
||||||
|
});
|
||||||
|
observer.observe(document.body, { childList: true, subtree: true });
|
||||||
|
}
|
||||||
|
|
||||||
export function tryLoad() {
|
export function tryLoad() {
|
||||||
if (isSeqtaEngageExperience()) {
|
if (isSeqtaEngageExperience()) {
|
||||||
updateIframesWithDarkMode();
|
updateIframesWithDarkMode();
|
||||||
window.addEventListener(
|
window.addEventListener("load", () => removeThemeTagsFromNotices(), { once: true });
|
||||||
"load",
|
|
||||||
() => removeThemeTagsFromNotices(),
|
const runEngageLoad = () => {
|
||||||
{ once: true },
|
if (document.querySelector(".login")) {
|
||||||
);
|
finishLoad();
|
||||||
window.addEventListener(
|
watchForEngageLogin();
|
||||||
"load",
|
return;
|
||||||
() => void finishLoad(),
|
}
|
||||||
{ once: true },
|
void LoadPageElements();
|
||||||
);
|
};
|
||||||
waitForElm(".login").then(() => void finishLoad());
|
|
||||||
waitForElm(".day-container").then(() => void finishLoad());
|
if (document.readyState === "complete") {
|
||||||
waitForElm(".code", true, 50).then((elm: any) => {
|
runEngageLoad();
|
||||||
if (!elm.innerText.includes("BetterSEQTA")) void LoadPageElements();
|
} else {
|
||||||
});
|
window.addEventListener("load", () => runEngageLoad(), { once: true });
|
||||||
|
}
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user