From c578e84d73fd12d427d7db440a5fcf5293407738 Mon Sep 17 00:00:00 2001 From: Julien Maille Date: Thu, 30 Sep 2021 20:40:21 +0200 Subject: [PATCH] Clean fix for pickCoverColor issue on startup --- dribbblish-dynamic.js | 4 ++-- user.css | 5 ----- 2 files changed, 2 insertions(+), 7 deletions(-) diff --git a/dribbblish-dynamic.js b/dribbblish-dynamic.js index 59cb087..a862823 100644 --- a/dribbblish-dynamic.js +++ b/dribbblish-dynamic.js @@ -1,4 +1,4 @@ -let current = '2.0' +let current = '2.1' /* css is injected so this works with untouched user.css from Dribbblish */ /* dark theme */ @@ -286,7 +286,7 @@ function pickCoverColor(img) { function hookCoverChange(pick) { waitForElement([".cover-art-image"], (queries) => { coverListenerInstalled = true - if (pick) pickCoverColor(queries[0]) + if (pick && queries[0].complete && queries[0].naturalHeight !== 0) pickCoverColor(queries[0]) queries[0].addEventListener('load', function() { try { pickCoverColor(queries[0]) diff --git a/user.css b/user.css index 26646bd..b716a08 100644 --- a/user.css +++ b/user.css @@ -1,8 +1,3 @@ -/* Temporay fix for Canvas taking up half the screen */ -body > canvas[width="250"][height="250"] { - display: none; -} - :root { --bar-height: 70px; --bar-cover-art-size: 40px;