fix pleroma FE crash cycling
This commit is contained in:
parent
1b37598723
commit
7184f11baa
1 changed files with 50 additions and 42 deletions
10
rot.js
10
rot.js
|
@ -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
|
||||||
|
|
Loading…
Reference in a new issue