diff --git a/macOS/Navigation/ActivePostToolbarView.swift b/macOS/Navigation/ActivePostToolbarView.swift index ef1ca42..3674d5b 100644 --- a/macOS/Navigation/ActivePostToolbarView.swift +++ b/macOS/Navigation/ActivePostToolbarView.swift @@ -42,7 +42,7 @@ struct ActivePostToolbarView: View { publishPost(activePost) } } else { - // present login screen + openSettingsWindow() } }, label: { Text("\(model.account.server == "https://write.as" ? "Anonymous" : "Drafts")") @@ -55,7 +55,7 @@ struct ActivePostToolbarView: View { publishPost(activePost) } } else { - // present login screen + openSettingsWindow() } }, label: { Text("\(collection.title)") @@ -95,4 +95,9 @@ struct ActivePostToolbarView: View { model.publish(post: post) } } + + private func openSettingsWindow() { + guard let menuItem = NSApplication.shared.mainMenu?.item(at: 0)?.submenu?.item(at: 2) else { return } + NSApplication.shared.sendAction(menuItem.action!, to: menuItem.target, from: nil) + } }