mirror of
https://github.com/writeas/writefreely-swiftui-multiplatform.git
synced 2024-11-15 01:11:02 +00:00
Merge pull request #84 from writeas/prompt-to-login-on-publish
Open the preferences window on publish if not logged in [macOS]
This commit is contained in:
commit
c08e1c2d07
@ -115,7 +115,10 @@ struct PostEditorView: View {
|
||||
if model.account.isLoggedIn {
|
||||
publishPost()
|
||||
} else {
|
||||
// TODO: Open the Preferences window.
|
||||
let mainMenu = NSApplication.shared.mainMenu
|
||||
let appMenuItem = mainMenu?.item(withTitle: "WriteFreely")
|
||||
let prefsItem = appMenuItem?.submenu?.item(withTitle: "Preferences…")
|
||||
NSApplication.shared.sendAction(prefsItem!.action!, to: prefsItem?.target, from: nil)
|
||||
}
|
||||
}, label: {
|
||||
Image(systemName: "paperplane")
|
||||
|
Loading…
Reference in New Issue
Block a user