mangerlahn / Latest

A small utility app for macOS that makes sure you know about all the latest updates to the apps you use.
https://max.codes/latest
GNU General Public License v3.0
2.88k stars 82 forks source link

Open applications asynchronously in macOS 10.15 and later #360

Closed cprecioso closed 4 months ago

cprecioso commented 4 months ago

I don't know if this PR should be against main or develop, feel free to change that. Also sorry that I didn't open an issue first; but the proposed fix is very straight-forward.

Latest opens applications with the synchronous method, which makes it wait for the opening. This can be a long time for big apps (or if online connectivity is spotty), during which Latest remains unresponsive.

To fix that, we can use the asynchronous method, which doesn't make the thread (and the app) wait. It is only available in macOS 10.15+, so we wrap it in an @available check.

The same way that in the previous code we ignored the return value, we can ignore the completionHandler here too.

mangerlahn commented 4 months ago

Awesome, thank you!