Skip to content

Commit

Permalink
Skip to invert a favicon when error (Croydon#114)
Browse files Browse the repository at this point in the history
  • Loading branch information
mmktomato committed Dec 17, 2018
1 parent 7f8d4d3 commit 763b3a1
Showing 1 changed file with 11 additions and 8 deletions.
19 changes: 11 additions & 8 deletions sidebar.js
Original file line number Diff line number Diff line change
Expand Up @@ -365,15 +365,18 @@ let VerticalTabsReloaded = class VerticalTabsReloaded
const fac = new FastAverageColor();
fac.getColorAsync(imgEl, (color) =>
{
if(color.isDark)
if(!color.error)
{
imgEl.classList.remove("tab-icon-image-light");
imgEl.classList.add("tab-icon-image-dark");
}
else
{
imgEl.classList.remove("tab-icon-image-dark");
imgEl.classList.add("tab-icon-image-light");
if(color.isDark)
{
imgEl.classList.remove("tab-icon-image-light");
imgEl.classList.add("tab-icon-image-dark");
}
else
{
imgEl.classList.remove("tab-icon-image-dark");
imgEl.classList.add("tab-icon-image-light");
}
}
log.debug(color);
fac.destroy();
Expand Down

0 comments on commit 763b3a1

Please sign in to comment.