Skip to content

Fix the extra icons added when changing icon packs#64

Merged
Claudiohbsantos merged 1 commit intomaterial-extensions:masterfrom
csandman:patch-1
Apr 28, 2023
Merged

Fix the extra icons added when changing icon packs#64
Claudiohbsantos merged 1 commit intomaterial-extensions:masterfrom
csandman:patch-1

Conversation

@csandman
Copy link
Contributor

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.

Copy link
Member

@Claudiohbsantos Claudiohbsantos left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah, this looks great to me. That was some quick work!

@Claudiohbsantos Claudiohbsantos merged commit 7fd5ace into material-extensions:master Apr 28, 2023
@csandman csandman deleted the patch-1 branch April 28, 2023 14:22
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Duplicated Icons when changing icon Packs on 1.8.0

2 participants