mirror of
https://github.com/writeas/writefreely-swiftui-multiplatform.git
synced 2024-11-15 01:11:02 +00:00
Open the preferences window on publish if not logged in [macOS]
This commit is contained in:
parent
e735e7a3d1
commit
cf5f0fe4de
@ -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