fix pleroma FE crash cycling

This commit is contained in:
uwaa 2025-01-13 02:12:23 +00:00
parent 1b37598723
commit 7184f11baa

10
rot.js
View file

@ -71,7 +71,11 @@
function setImage(url) { function setImage(url) {
if (url) { if (url) {
console.log("Setting background: " + url); console.log("Setting background: " + url);
document.getElementById("app-loaded").style.setProperty("--body-background-image", "url(" + url + ")"); let apploaded = document.getElementById("app-loaded");
if (apploaded)
apploaded.style.setProperty("--body-background-image", "url(" + url + ")");
else
console.log("Couldn't set background, app not yet loaded");
} }
} }
@ -192,6 +196,7 @@
//Switch-based monkey patching router bullshit //Switch-based monkey patching router bullshit
let lastPath = null; let lastPath = null;
function updateRot() { function updateRot() {
try {
let newPath = window.location.pathname; let newPath = window.location.pathname;
if (lastPath == newPath) if (lastPath == newPath)
return; return;
@ -242,6 +247,9 @@
applyMainTheme(); applyMainTheme();
break; break;
} }
} catch (e) {
console.error(e);
}
} }
//Rot music player //Rot music player