Skip to content

Commit 59812a4

Browse files
committed
Add icons to the context menu of MyArticleItemView
1 parent cfcba93 commit 59812a4

File tree

3 files changed

+26
-19
lines changed

3 files changed

+26
-19
lines changed

Diff for: Planet/Entities/PlanetStore.swift

+6-4
Original file line numberDiff line numberDiff line change
@@ -407,10 +407,12 @@ enum PlanetDetailViewType: Hashable, Equatable {
407407
}
408408
}
409409
case .unread:
410-
selectedArticleList = getUnreadArticles()
411-
navigationTitle = "Unread"
412-
if let articles = selectedArticleList {
413-
navigationSubtitle = "\(articles.count) unread"
410+
Task { @MainActor in
411+
selectedArticleList = getUnreadArticles()
412+
navigationTitle = "Unread"
413+
if let articles = selectedArticleList {
414+
navigationSubtitle = "\(articles.count) unread"
415+
}
414416
}
415417
case .starred:
416418
selectedArticleList = getStarredArticles()

Diff for: Planet/Views/My/MyArticleItemView.swift

+19-14
Original file line numberDiff line numberDiff line change
@@ -120,6 +120,23 @@ struct MyArticleItemView: View {
120120
}
121121
}
122122
}
123+
124+
Menu("Star") {
125+
ArticleSetStarView(article: article)
126+
}
127+
if article.starred != nil {
128+
Button {
129+
article.starred = nil
130+
try? article.save()
131+
Task.detached {
132+
await PlanetStore.shared.updateTotalStarredCount()
133+
}
134+
} label: {
135+
Text("Remove Star")
136+
}
137+
}
138+
139+
Divider()
123140

124141
moveArticleItem()
125142

@@ -158,22 +175,9 @@ struct MyArticleItemView: View {
158175
PlanetStore.shared.isShowingDeleteMyArticleConfirmation = true
159176
PlanetStore.shared.deletingMyArticle = article
160177
} label: {
178+
Image(systemName: "minus.circle")
161179
Text("Delete Article")
162180
}
163-
Menu("Star") {
164-
ArticleSetStarView(article: article)
165-
}
166-
if article.starred != nil {
167-
Button {
168-
article.starred = nil
169-
try? article.save()
170-
Task.detached {
171-
await PlanetStore.shared.updateTotalStarredCount()
172-
}
173-
} label: {
174-
Text("Remove Star")
175-
}
176-
}
177181
if article.pinned == nil {
178182
Button {
179183
Task {
@@ -184,6 +188,7 @@ struct MyArticleItemView: View {
184188
}
185189
}
186190
} label: {
191+
Image(systemName: "arrow.up.to.line")
187192
Text("Pin Article")
188193
}
189194
}

Diff for: Planet/versioning.xcconfig

+1-1
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
CURRENT_PROJECT_VERSION = 2330
1+
CURRENT_PROJECT_VERSION = 2330

0 commit comments

Comments
 (0)