fix error in console

remotes/1693045480750635534/spooky-22
Aevann1 2022-09-20 20:54:52 +02:00
parent 7544be2f0f
commit c10342e835
1 changed files with 14 additions and 11 deletions

View File

@ -895,7 +895,9 @@
const detectionDiv = document.querySelector('#detection');
const isAutoDark = getComputedStyle(detectionDiv).backgroundColor != 'rgb(255, 255, 255)';
if (!isAutoDark) {
const element = document.getElementsByClassName('comment-section')[0];
let element = document.getElementsByClassName('comment-section')
if (element) {
element = element[0];
let color = getComputedStyle(element).getPropertyValue('background-color');
color = 'rgba' + color.slice(3,-1) + ', 0.1)'
@ -908,6 +910,7 @@
style.innerHTML = `.actual-post:not(.deleted):not(.banned),.comment-section>.comment{background-image:url("data:image/svg+xml;base64,${base64Mark}")}`;
document.getElementsByTagName('head')[0].appendChild(style);
}
}
</script>
{% endif %}