diff options
| author | Dustin Mierau <dustin@mierau.me> | 2024-05-16 20:57:05 -0700 |
|---|---|---|
| committer | Dustin Mierau <dustin@mierau.me> | 2024-05-16 20:57:05 -0700 |
| commit | 277c4cb65218adb8485bb28560a9bb4cca42da82 (patch) | |
| tree | bbd368a8388122f486ccfd109b5e906390aba5ac /Hotline/macOS | |
| parent | 1be30131690e32080da64324a70133e11281eb27 (diff) | |
Enable CloudKit. Fix saving server bookmarks. Remove old bookmarks code.
Diffstat (limited to 'Hotline/macOS')
| -rw-r--r-- | Hotline/macOS/ServerView.swift | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/Hotline/macOS/ServerView.swift b/Hotline/macOS/ServerView.swift index 64c3fbd..e3f0596 100644 --- a/Hotline/macOS/ServerView.swift +++ b/Hotline/macOS/ServerView.swift @@ -127,11 +127,11 @@ enum ServerNavigationType: Identifiable, Hashable, Equatable { } struct ServerView: View { - @Environment(BookmarksOld.self) private var bookmarks: BookmarksOld @Environment(\.dismiss) var dismiss @Environment(\.colorScheme) private var colorScheme @Environment(\.controlActiveState) private var controlActiveState @Environment(\.scenePhase) private var scenePhase + @Environment(\.modelContext) private var modelContext @State private var model: Hotline = Hotline(trackerClient: HotlineTrackerClient(), client: HotlineClient()) @State private var state: ServerState = ServerState(selection: .chat) @@ -334,7 +334,8 @@ struct ServerView: View { let password: String? = connectPassword.isEmpty ? nil : connectPassword if !host.isEmpty { - let _ = bookmarks.add(BookmarkOld(type: .server, name: name, address: host, port: port, login: login, password: password)) + let newBookmark = Bookmark(type: .server, name: name, address: host, port: port, login: login, password: password) + Bookmark.add(newBookmark, context: modelContext) } } } |