File tree Expand file tree Collapse file tree 1 file changed +6
-4
lines changed
Expand file tree Collapse file tree 1 file changed +6
-4
lines changed Original file line number Diff line number Diff line change @@ -238,8 +238,9 @@ struct SushitrainApp: App {
238238 }
239239 . windowResizability ( . contentSize)
240240
241- MenuBarExtraView ( hideInDock: $hideInDock)
242- . environment ( appState)
241+ // Pass app state object explicitly, as sometimes Environment fails to resolve
242+ // for some reason...
243+ MenuBarExtraView ( appState: appState, hideInDock: $hideInDock)
243244
244245 Settings {
245246 NavigationStack {
@@ -267,9 +268,9 @@ struct SushitrainApp: App {
267268
268269#if os(macOS)
269270 struct MenuBarExtraView : Scene {
271+ let appState : AppState
270272 @Binding var hideInDock : Bool
271273 @Environment ( \. openWindow) private var openWindow
272- @Environment ( AppState . self) private var appState
273274
274275 @State private var folders : [ SushitrainFolder ] = [ ]
275276
@@ -278,11 +279,12 @@ struct SushitrainApp: App {
278279 NavigationStack {
279280 TabbedSettingsView ( hideInDock: $hideInDock)
280281 }
281- }
282+ } . environment ( appState )
282283
283284 MenuBarExtra ( " Synctrain " , systemImage: self . menuIcon, isInserted: $hideInDock) {
284285 if appState. startupState == . started {
285286 OverallStatusView ( )
287+ . environment ( appState)
286288 . task {
287289 await self . update ( )
288290 }
You can’t perform that action at this time.
0 commit comments