mirror of
https://github.com/lil-org/wallet.git
synced 2025-01-06 04:13:11 +03:00
Don't iterate over all running apps
This commit is contained in:
parent
87492d90ff
commit
eb045017dd
@ -24,9 +24,8 @@ struct Window {
|
||||
|
||||
static func activateBrowser() {
|
||||
// TODO: support more browsers
|
||||
let apps = NSWorkspace().runningApplications
|
||||
for bundleId in ["com.apple.Safari", "com.google.Chrome"] {
|
||||
if let browser = apps.first(where: { $0.bundleIdentifier == bundleId}) {
|
||||
if let browser = NSRunningApplication.runningApplications(withBundleIdentifier: bundleId).first {
|
||||
browser.activate(options: .activateIgnoringOtherApps)
|
||||
return
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user