aboutsummaryrefslogtreecommitdiff
path: root/Hotline/macOS
diff options
context:
space:
mode:
authorDustin Mierau <dustin@mierau.me>2024-05-16 20:57:05 -0700
committerDustin Mierau <dustin@mierau.me>2024-05-16 20:57:05 -0700
commit277c4cb65218adb8485bb28560a9bb4cca42da82 (patch)
treebbd368a8388122f486ccfd109b5e906390aba5ac /Hotline/macOS
parent1be30131690e32080da64324a70133e11281eb27 (diff)
Enable CloudKit. Fix saving server bookmarks. Remove old bookmarks code.
Diffstat (limited to 'Hotline/macOS')
-rw-r--r--Hotline/macOS/ServerView.swift5
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)
}
}
}