Skip to content

Commit

Permalink
fix: Quit from the menu (#16)
Browse files Browse the repository at this point in the history
  • Loading branch information
jbmorley authored Jun 22, 2024
1 parent 8896e9e commit 535db8b
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 1 deletion.
4 changes: 4 additions & 0 deletions Reconnect/Model/ApplicationModel.swift
Original file line number Diff line number Diff line change
Expand Up @@ -39,4 +39,8 @@ class ApplicationModel {
device = keyedDefaults.string(forKey: .device, default: "")
}

@MainActor func quit() {
NSApplication.shared.terminate(nil)
}

}
6 changes: 5 additions & 1 deletion Reconnect/Views/MainMenu.swift
Original file line number Diff line number Diff line change
Expand Up @@ -30,11 +30,15 @@ struct MainMenu: View {

var body: some View {
@Bindable var applicationModel = applicationModel
Button("Settings") {
Button("Settings...") {
openURL(.settings)
}
Divider()
Toggle("Open at Login", isOn: $application.openAtLogin)
Divider()
Button("Quit") {
applicationModel.quit()
}
}

}

0 comments on commit 535db8b

Please sign in to comment.