← All repositories

crossmate

A collaborative crossword app for iPhone and iPad

git clone https://code.inqk.net/crossmate.git


commit 52fde63a3fa878af1fd1276b29047997d0bbfe13
parent c2bc617cfc408c754003ca2cde67bbdb5b75fa11
Author: Michael Camilleri <[email protected]>
Date:   Fri, 17 Apr 2026 15:51:57 +0900

Tidy up naming

Diffstat

MCrossmate/CrossmateApp.swift | 25++++++++++---------------

1 file changed, 10 insertions(+), 15 deletions(-)

diff --git a/Crossmate/CrossmateApp.swift b/Crossmate/CrossmateApp.swift

@@ -17,11 +17,11 @@ struct CrossmateApp: App {
                 appDelegate: appDelegate
             )
             .environment(\.managedObjectContext, services.persistence.viewContext)
-            .environment(services.nytAuth)
             .environment(services.driveMonitor)
             .environment(services.syncMonitor)
-            .environment(\.nytPuzzleFetcher, services.nytFetcher)
             .environment(\.syncEngine, services.syncEngine)
+            .environment(services.nytAuth)
+            .environment(\.nytPuzzleFetcher, services.nytFetcher)
         }
     }
 }
@@ -98,19 +98,6 @@ private struct PuzzleDisplayView: View {
     @State private var session: PlayerSession?
     @State private var loadError: String?
 
-    init(gameID: UUID, store: GameStore) {
-        self.gameID = gameID
-        self.store = store
-
-        do {
-            let (game, mutator) = try store.loadGame(id: gameID)
-            let playerSession = PlayerSession(game: game, mutator: mutator)
-            self._session = State(initialValue: playerSession)
-        } catch {
-            self._loadError = State(initialValue: String(describing: error))
-        }
-    }
-
     var body: some View {
         Group {
             if let session {
@@ -125,5 +112,13 @@ private struct PuzzleDisplayView: View {
         }
         .navigationTitle("")
         .navigationBarTitleDisplayMode(.inline)
+        .task(id: gameID) {
+            do {
+                let (game, mutator) = try store.loadGame(id: gameID)
+                session = PlayerSession(game: game, mutator: mutator)
+            } catch {
+                loadError = String(describing: error)
+            }
+        }
     }
 }