Skip to content

Commit

Permalink
Add a button on toolbar for editing MyArticle
Browse files Browse the repository at this point in the history
  • Loading branch information
livid committed Dec 7, 2023
1 parent 7c85068 commit 119f41f
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 1 deletion.
18 changes: 18 additions & 0 deletions Planet/Views/Articles/ArticleView.swift
Original file line number Diff line number Diff line change
Expand Up @@ -277,6 +277,7 @@ struct ArticleView: View {
ArticleToolbarStarView(article: article)
}
}

if let article = planetStore.selectedArticle,
article.hasAudio
{
Expand All @@ -289,6 +290,21 @@ struct ArticleView: View {
{
toolbarAttachmentsView(article: article)
}

if let article = planetStore.selectedArticle as? MyArticleModel, !article.isAggregated() {
Button {
do {
try WriterStore.shared.editArticle(for: article)
}
catch {
PlanetStore.shared.alert(title: "Failed to launch writer")
}
} label: {
Image(systemName: "pencil.line")
}
.help("Edit Selected Article")
.keyboardShortcut("e", modifiers: [.command])
}
}

ToolbarItemGroup(placement: .automatic) {
Expand All @@ -298,6 +314,7 @@ struct ArticleView: View {
} label: {
Image(systemName: "magnifyingglass")
}
.help("Search")
.keyboardShortcut("f", modifiers: [.command])

if let article = planetStore.selectedArticle {
Expand All @@ -314,6 +331,7 @@ struct ArticleView: View {
]
)
)
.help("Share Selected Article")
}
}
}
Expand Down
2 changes: 1 addition & 1 deletion Planet/versioning.xcconfig
Original file line number Diff line number Diff line change
@@ -1 +1 @@
CURRENT_PROJECT_VERSION = 1820
CURRENT_PROJECT_VERSION = 1821

0 comments on commit 119f41f

Please sign in to comment.