-
-
Notifications
You must be signed in to change notification settings - Fork 33
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Code cleanup #161
Code cleanup #161
Conversation
export let optionsUrl; | ||
export let icons; // Optional | ||
export let icons = undefined; // eslint-disable-line no-undef-init -- Optional svelte property |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
eslint autofixed this away from #160
@@ -0,0 +1,20 @@ | |||
export default function pickBestIcon(icons, size = 16) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I had to rewrite this function because I had messed up and never checked. Tests FTW
} | ||
|
||
// If it's not available (e.g. requested 32, available only 16), get the largest one | ||
return smallestToLargest.at(-1).url; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The main change is that it will now never pick the fallback if any icons exist.
No description provided.