aboutsummaryrefslogtreecommitdiff
path: root/Hotline
diff options
context:
space:
mode:
authorDustin Mierau <dustin@mierau.me>2023-12-20 15:55:50 -0800
committerDustin Mierau <dustin@mierau.me>2023-12-20 15:55:50 -0800
commit101cbcacb671a1621af6ee2a49ac2021f9abe1c6 (patch)
tree93643eb4a429131dbdf3fc4f2b9e529e9af9cef0 /Hotline
parent5658209bd322449f4b54fa4a3047a485cc2ed32c (diff)
Stop requesting news when closing category. Add Server should do nothing right now (was hooked up to refresh).
Diffstat (limited to 'Hotline')
-rw-r--r--Hotline/macOS/NewsView.swift12
-rw-r--r--Hotline/macOS/TrackerView.swift8
2 files changed, 7 insertions, 13 deletions
diff --git a/Hotline/macOS/NewsView.swift b/Hotline/macOS/NewsView.swift
index 3c35b1b..15e9db4 100644
--- a/Hotline/macOS/NewsView.swift
+++ b/Hotline/macOS/NewsView.swift
@@ -3,8 +3,6 @@ import UniformTypeIdentifiers
struct NewsItemView: View {
@Environment(Hotline.self) private var model: Hotline
-
- @State var expanded = false
var news: NewsInfo
let depth: Int
@@ -79,15 +77,13 @@ struct NewsItemView: View {
.frame(maxWidth: .infinity, maxHeight: .infinity)
.padding(.leading, CGFloat(depth * (12 + 10)))
.onChange(of: news.expanded) {
-// if news.isFolder {
- print("EXPANDED \(news.name)? \(expanded)")
if news.type == .bundle || news.type == .category {
- Task {
- await model.getNewsList(at: news.path)
-// await model.getFileList(path: file.path)
+ if news.expanded {
+ Task {
+ await model.getNewsList(at: news.path)
+ }
}
}
-// }
}
if news.expanded {
diff --git a/Hotline/macOS/TrackerView.swift b/Hotline/macOS/TrackerView.swift
index 02e0c5e..ca1595d 100644
--- a/Hotline/macOS/TrackerView.swift
+++ b/Hotline/macOS/TrackerView.swift
@@ -165,9 +165,10 @@ struct TrackerItemView: View {
Text("\(server.users) \(Image(systemName: "person.fill"))")
.lineLimit(1)
.foregroundStyle(.secondary)
- .padding([.leading, .trailing], 8)
+ .padding([.leading, .trailing], 4)
.padding([.top, .bottom], 2)
- .background(Capsule(style: .circular).stroke(.secondary.opacity(0.3), lineWidth: 1))
+// .background(Capsule(style: .circular).stroke(.secondary, lineWidth: 1))
+// .opacity(0.5)
}
else if
let bookmark = item.bookmark,
@@ -360,9 +361,6 @@ struct TrackerView: View {
ToolbarItem(placement: .primaryAction) {
Button {
- Task {
- await refresh()
- }
} label: {
Label("Add Server", systemImage: "plus")
}