diff options
| author | Dustin Mierau <dustin@mierau.me> | 2024-01-03 23:55:39 -0800 |
|---|---|---|
| committer | Dustin Mierau <dustin@mierau.me> | 2024-01-03 23:55:39 -0800 |
| commit | cc6e0e35cf6e662ffc3ad24e2510265caa5cf52a (patch) | |
| tree | 908b99f7995edf9dc911209be656fb731c47c5ad /Hotline/Application.swift | |
| parent | 2286040715ff8c08c4114c60e81f087f92d53800 (diff) | |
Server windows restore with app session now. Implemented new login view so you can connect to specific IP servers no listed by tracker, login/pass supported (I think?), and a nicer connect progress display.
Diffstat (limited to 'Hotline/Application.swift')
| -rw-r--r-- | Hotline/Application.swift | 26 |
1 files changed, 9 insertions, 17 deletions
diff --git a/Hotline/Application.swift b/Hotline/Application.swift index 9c966d0..8e1b4d9 100644 --- a/Hotline/Application.swift +++ b/Hotline/Application.swift @@ -1,13 +1,18 @@ import SwiftUI import SwiftData +enum ServerWindowDestination: Hashable, Codable { + case server(server: Server) + case none +} + @main struct Application: App { #if os(iOS) private var model = Hotline(trackerClient: HotlineTrackerClient(), client: HotlineClient()) #endif - private var preferences = Prefs() + @State private var preferences = Prefs() var body: some Scene { #if os(iOS) @@ -24,20 +29,9 @@ struct Application: App { .defaultPosition(.center) WindowGroup(id: "server", for: Server.self) { $server in - if let s = server { - ServerView(server: s) - .frame(minWidth: 400, minHeight: 300) - .environment(Hotline(trackerClient: HotlineTrackerClient(), client: HotlineClient())) - .environment(preferences) - .toolbar { - ToolbarItem(placement: .navigation) { - Image(systemName: "globe.americas.fill") - .resizable() - .scaledToFit() - .frame(width: 18) - } - } - } + ServerView(server: $server) + .frame(minWidth: 400, minHeight: 300) + .environment(preferences) } .defaultSize(width: 700, height: 800) .defaultPosition(.center) @@ -50,12 +44,10 @@ struct Application: App { // } // } -#if os(macOS) Settings { SettingsView() .environment(preferences) } -#endif #endif } |