aboutsummaryrefslogtreecommitdiff
path: root/Hotline/macOS/NewsView.swift
diff options
context:
space:
mode:
Diffstat (limited to 'Hotline/macOS/NewsView.swift')
-rw-r--r--Hotline/macOS/NewsView.swift15
1 files changed, 12 insertions, 3 deletions
diff --git a/Hotline/macOS/NewsView.swift b/Hotline/macOS/NewsView.swift
index ed5d969..6f24193 100644
--- a/Hotline/macOS/NewsView.swift
+++ b/Hotline/macOS/NewsView.swift
@@ -121,16 +121,15 @@ struct NewsView: View {
ToolbarItem(placement: .primaryAction) {
Button {
+ loading = true
if let selectionPath = selection?.path {
Task {
- loading = true
await model.getNewsList(at: selectionPath)
loading = false
}
}
else {
Task {
- loading = true
await model.getNewsList()
loading = false
}
@@ -153,7 +152,17 @@ struct NewsView: View {
.listStyle(.inset)
.alternatingRowBackgrounds(.enabled)
.contextMenu(forSelectionType: NewsInfo.self) { items in
- // ...
+ let selectedItem = items.first
+
+ Button {
+ if selectedItem?.type == .article {
+ replyOpen = true
+ }
+ } label: {
+ Label("Reply to \(selectedItem?.articleUsername ?? "Post")", systemImage: "arrowshape.turn.up.left")
+ }
+ .disabled(selectedItem == nil || selectedItem?.type != .article)
+
} primaryAction: { items in
guard let clickedNews = items.first else {
return