Add “Check For Updates” entry to app menu

This commit is contained in:
Angelo Stavrow 2020-12-23 10:21:23 -05:00
parent 4eb5d269aa
commit fb13b9e8ab
No known key found for this signature in database
GPG Key ID: 1A49C7064E060EEE

View File

@ -1,5 +1,9 @@
import SwiftUI
#if os(macOS)
import Sparkle
#endif
@main
struct CheckForDebugModifier {
static func main() {
@ -40,6 +44,14 @@ struct WriteFreely_MultiPlatformApp: App {
// .preferredColorScheme(preferences.selectedColorScheme) // See PreferencesModel for info.
}
.commands {
#if os(macOS)
CommandGroup(after: .appInfo, addition: {
Button("Check For Updates") {
print("Checking for updates!")
SUUpdater.shared()?.checkForUpdates(self)
}
})
#endif
CommandGroup(replacing: .newItem, addition: {
Button("New Post") {
createNewLocalPost()