Skip to content
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

fix: app launcher performance on mac #1166

Merged
merged 1 commit into from
Mar 22, 2023
Merged

Conversation

dodgez
Copy link
Contributor

@dodgez dodgez commented Mar 16, 2023

Previous discussion: #1161

I decided to "revert" some of the changes in that PR and just add a check for win32 so we can keep the performance on a mac and have support for win32.

I considered forking get-app-icon, but realistically it doesn't really support arrays of files to get icons for and would be a large amount of effort when this code can fix it and this is a breaking problem on my work computer.

Curious to get your thoughts @johnlindquist @fcrespo82

Comment on lines +45 to +48
let extractIcon =
process.platform === "win32"
? (await npm("get-app-icon")).extractIcon
: () => Promise.resolve(undefined)
Copy link
Contributor Author

Choose a reason for hiding this comment

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

I define this up here instead of the loop below for performance and I return a function that returns a promise when on other platforms because we .catch down below.

@fcrespo82
Copy link

I think it could be a good compromise for now.

I found another way to extract windows icons, and it's a little better at extracting icons from links. At least in my tests.
I'll try to hack a simple library to extract windows icons and see if it is worth it.

I took the liberty of opening a discussion #1168 to document this effort to make it work cross-platform.

@johnlindquist johnlindquist merged commit 19b673c into johnlindquist:main Mar 22, 2023
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.

3 participants