From e5f8a13f05a9c845e1f76caa95a28a2a4b71a435 Mon Sep 17 00:00:00 2001 From: Christoffer Winterkvist Date: Tue, 18 Jun 2024 23:53:36 +0200 Subject: [PATCH] fix: ensure menu items are enabled before finding them --- App/Sources/Core/Runners/MenuBarCommandRunner.swift | 2 ++ 1 file changed, 2 insertions(+) diff --git a/App/Sources/Core/Runners/MenuBarCommandRunner.swift b/App/Sources/Core/Runners/MenuBarCommandRunner.swift index ae3beaf2..fd862063 100644 --- a/App/Sources/Core/Runners/MenuBarCommandRunner.swift +++ b/App/Sources/Core/Runners/MenuBarCommandRunner.swift @@ -80,6 +80,8 @@ final class MenuBarCommandRunner { private func find(_ token: MenuBarCommand.Token, in items: [MenuBarItemAccessibilityElement]) -> MenuBarItemAccessibilityElement? { items.first(where: { item in + guard item.isEnabled == true else { return false } + switch token { case .menuItem(let title): return item.title == title