antfu-collective / icones

⚡️ Icon Explorer with Instant searching, powered by Iconify
https://icones.js.org
MIT License
5.13k stars 250 forks source link

Bag: Download zip not working #160

Closed AustinGil closed 1 year ago

AustinGil commented 1 year ago

Describe the bug

When I try to download the Zip file from the bag, it does not work. There is just an error in the console.

Reproduction

Open app > Add icon to bag > Open Bag > Click Download Zip > select any of the download options

System Info

https://icones.js.org/ in Edge and Chrome

Used Package Manager

n/a

Validations

antfu commented 1 year ago

Seems to work for me. What's the error you are seeing?

AustinGil commented 1 year ago

Unfortunately, it's not a very helpful error. It's just the name of the first icon in the bag.

Screen Recording - Made with RecordCast.webm

SharerMax commented 1 year ago

When collection name contain -, full icon name will be converted only has -. So API of iconify can't parse collection name correctly.

https://github.com/antfu/icones/blob/348eab1d9d864afcf915e71f0874217e805c2425/src/components/Bag.vue#L28-L34

e.g. material-symbols:15mp-outline-rounded -> material-symbols-15mp-outline-rounded collection name: material icon name: symbols-15mp-outline-rounded https://api.iconify.design/material.json?icons=symbols-15mp-outline-rounded ( from loadIcon)404 https://api.iconify.design/material-symbols-15mp-outline-rounded.svg 404 (from api)

But, we can use origin name to keep : as separator between collection and icon. Iconify can parse collection name and icon name correctly. collection name: material-symbols icon name: 15mp-outline-rounded https://api.iconify.design/material-symbols.json?icons=15mp-outline-rounded 200 OK https://api.iconify.design/material-symbols:15mp-outline-rounded.svg 200 OK