From 119f41faee3c53666b91d6d30678b9bb8ddddcd2 Mon Sep 17 00:00:00 2001 From: Xin Liu Date: Thu, 7 Dec 2023 05:36:14 -0800 Subject: [PATCH] Add a button on toolbar for editing MyArticle --- Planet/Views/Articles/ArticleView.swift | 18 ++++++++++++++++++ Planet/versioning.xcconfig | 2 +- 2 files changed, 19 insertions(+), 1 deletion(-) diff --git a/Planet/Views/Articles/ArticleView.swift b/Planet/Views/Articles/ArticleView.swift index 2b29e8c7..3f6e9bf0 100644 --- a/Planet/Views/Articles/ArticleView.swift +++ b/Planet/Views/Articles/ArticleView.swift @@ -277,6 +277,7 @@ struct ArticleView: View { ArticleToolbarStarView(article: article) } } + if let article = planetStore.selectedArticle, article.hasAudio { @@ -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) { @@ -298,6 +314,7 @@ struct ArticleView: View { } label: { Image(systemName: "magnifyingglass") } + .help("Search") .keyboardShortcut("f", modifiers: [.command]) if let article = planetStore.selectedArticle { @@ -314,6 +331,7 @@ struct ArticleView: View { ] ) ) + .help("Share Selected Article") } } } diff --git a/Planet/versioning.xcconfig b/Planet/versioning.xcconfig index f09372d4..01aaaa9a 100644 --- a/Planet/versioning.xcconfig +++ b/Planet/versioning.xcconfig @@ -1 +1 @@ -CURRENT_PROJECT_VERSION = 1820 +CURRENT_PROJECT_VERSION = 1821