aboutsummaryrefslogtreecommitdiff
path: root/Hotline/macOS/TrackerView.swift
diff options
context:
space:
mode:
Diffstat (limited to 'Hotline/macOS/TrackerView.swift')
-rw-r--r--Hotline/macOS/TrackerView.swift16
1 files changed, 13 insertions, 3 deletions
diff --git a/Hotline/macOS/TrackerView.swift b/Hotline/macOS/TrackerView.swift
index a52bccd..0fac8b0 100644
--- a/Hotline/macOS/TrackerView.swift
+++ b/Hotline/macOS/TrackerView.swift
@@ -18,8 +18,8 @@ struct TrackerView: View {
@State private var bookmarkExport: BookmarkDocument? = nil
@Query(sort: \Bookmark.order) private var bookmarks: [Bookmark]
- @State private var selection: Bookmark? = nil
-
+ @Binding var selection: Bookmark?
+
var body: some View {
List(selection: $selection) {
ForEach(bookmarks, id: \.self) { bookmark in
@@ -459,6 +459,16 @@ struct TrackerItemView: View {
}
}
+#if DEBUG
+private struct TrackerViewPreview: View {
+ @State var selection: Bookmark? = nil
+
+ var body: some View {
+ TrackerView(selection: $selection)
+ }
+}
+
#Preview {
- TrackerView()
+ TrackerViewPreview()
}
+#endif