material-extensions / material-icons-browser-extension

Browser Addon that enhances file browsers of version controls with material icons.
MIT License
499 stars 38 forks source link

Fix the extra icons added when changing icon packs #64

Closed csandman closed 1 year ago

csandman commented 1 year ago

Closes #63

This PR fixes the issue of the extra icons being added when the icon packs are switched. It appears the issue is being caused by the prepend behavior I used for the new icons. In the case where you attempt to replace the icon from this pack, it doesn't see a previous sibling with the icon pack, so it just prepends it.

The fix was checking to see if the svgEl the extension is looking at actually comes from this pack, and in the case where it does, actually do a replace instead of prepending it.