Clean fix for pickCoverColor issue on startup

This commit is contained in:
Julien Maille 2021-09-30 20:40:21 +02:00
parent 9fbedc1756
commit c578e84d73
2 changed files with 2 additions and 7 deletions

View file

@ -1,4 +1,4 @@
let current = '2.0' let current = '2.1'
/* css is injected so this works with untouched user.css from Dribbblish */ /* css is injected so this works with untouched user.css from Dribbblish */
/* dark theme */ /* dark theme */
@ -286,7 +286,7 @@ function pickCoverColor(img) {
function hookCoverChange(pick) { function hookCoverChange(pick) {
waitForElement([".cover-art-image"], (queries) => { waitForElement([".cover-art-image"], (queries) => {
coverListenerInstalled = true coverListenerInstalled = true
if (pick) pickCoverColor(queries[0]) if (pick && queries[0].complete && queries[0].naturalHeight !== 0) pickCoverColor(queries[0])
queries[0].addEventListener('load', function() { queries[0].addEventListener('load', function() {
try { try {
pickCoverColor(queries[0]) pickCoverColor(queries[0])

View file

@ -1,8 +1,3 @@
/* Temporay fix for Canvas taking up half the screen */
body > canvas[width="250"][height="250"] {
display: none;
}
:root { :root {
--bar-height: 70px; --bar-height: 70px;
--bar-cover-art-size: 40px; --bar-cover-art-size: 40px;