Skip to content

Commit d8c4491

Browse files
committed
fix: ensure toggle states are updated for menu items on macOS
Signed-off-by: Tommy van der Vorst <tommy@pixelspark.nl>
1 parent ae20916 commit d8c4491

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

Sushitrain/App.swift

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,9 @@ struct SushitrainApp: App {
1515

1616
@State fileprivate var appState: AppState
1717

18+
// Reference to appState.userSettings. This is needed because `body` needs to observe this
19+
@ObservedObject private var userSettings: AppUserSettings
20+
1821
fileprivate var delegate: SushitrainDelegate?
1922
private let qaService = QuickActionService.shared
2023

@@ -73,6 +76,7 @@ struct SushitrainApp: App {
7376

7477
let appState = AppState(client: client, documentsDirectory: documentsDirectory, configDirectory: configDirectory)
7578
self.appState = appState
79+
self.userSettings = appState.userSettings
7680

7781
AppDependencyManager.shared.add(dependency: appState)
7882
appState.isLoggingToFile = enableLoggingToFile

0 commit comments

Comments
 (0)