Skip to content

Commit

Permalink
Fix the extra icons added when changing icon packs (#64)
Browse files Browse the repository at this point in the history
  • Loading branch information
csandman authored Apr 28, 2023
1 parent 0c79245 commit 7fd5ace
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion src/providers/github.js
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,13 @@ const githubConfig = {
const prevEl = svgEl.previousElementSibling;
if (prevEl?.getAttribute('data-material-icons-extension') === 'icon') {
svgEl.parentNode.replaceChild(newSVG, prevEl);
} else {
}
// If the icon to replace is an icon from this extension, replace it with the new icon
else if (svgEl.getAttribute('data-material-icons-extension') === 'icon') {
svgEl.parentNode.replaceChild(newSVG, svgEl);
}
// If neither of the above, prepend the new icon in front of the original icon
else {
svgEl.parentNode.insertBefore(newSVG, svgEl);
}
},
Expand Down

0 comments on commit 7fd5ace

Please sign in to comment.