Page MenuHomeMusing Studio

No OneTemporary

diff --git a/macOS/Navigation/PostCommands.swift b/macOS/Navigation/PostCommands.swift
index 8b81d07..2b2d45a 100644
--- a/macOS/Navigation/PostCommands.swift
+++ b/macOS/Navigation/PostCommands.swift
@@ -1,38 +1,25 @@
import SwiftUI
struct PostCommands: Commands {
@ObservedObject var model: WriteFreelyModel
- @FetchRequest(
- entity: WFACollection.entity(),
- sortDescriptors: [NSSortDescriptor(keyPath: \WFACollection.title, ascending: true)]
- ) var collections: FetchedResults<WFACollection>
-
var body: some Commands {
CommandMenu("Post") {
Group {
- Button("Publish…") {
- print("Clicked 'Publish…' for post '\(model.selectedPost?.title ?? "untitled")'")
- }
- .disabled(true)
- Button("Move…") {
- print("Clicked 'Move…' for post '\(model.selectedPost?.title ?? "untitled")'")
- }
- .disabled(true)
Button(action: sendPostUrlToPasteboard, label: { Text("Copy Link To Published Post") })
.disabled(model.selectedPost?.status == PostStatus.local.rawValue)
}
.disabled(model.selectedPost == nil || !model.account.isLoggedIn)
}
}
private func sendPostUrlToPasteboard() {
guard let activePost = model.selectedPost else { return }
guard let postId = activePost.postId else { return }
guard let urlString = activePost.slug != nil ?
"\(model.account.server)/\((activePost.collectionAlias)!)/\((activePost.slug)!)" :
"\(model.account.server)/\((postId))" else { return }
NSPasteboard.general.clearContents()
NSPasteboard.general.setString(urlString, forType: .string)
}
}

File Metadata

Mime Type
text/x-diff
Expires
Fri, Jan 31, 2:58 PM (16 h, 32 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
3145834

Event Timeline