mirror of
https://github.com/yattee/yattee.git
synced 2025-11-30 05:08:13 +00:00
Add Sparkle update framework for macOS
This commit is contained in:
@@ -5,6 +5,7 @@ import SwiftUI
|
||||
struct YatteeApp: App {
|
||||
#if os(macOS)
|
||||
@NSApplicationDelegateAdaptor(AppDelegate.self) var appDelegate
|
||||
@StateObject private var updater = UpdaterModel()
|
||||
#endif
|
||||
|
||||
@StateObject private var menu = MenuModel()
|
||||
@@ -18,7 +19,16 @@ struct YatteeApp: App {
|
||||
.handlesExternalEvents(matching: Set(["*"]))
|
||||
.commands {
|
||||
SidebarCommands()
|
||||
|
||||
CommandGroup(replacing: .newItem, addition: {})
|
||||
|
||||
#if os(macOS)
|
||||
CommandGroup(after: .appInfo) {
|
||||
CheckForUpdatesView()
|
||||
.environmentObject(updater)
|
||||
}
|
||||
#endif
|
||||
|
||||
MenuCommands(model: Binding<MenuModel>(get: { menu }, set: { _ in }))
|
||||
}
|
||||
#endif
|
||||
@@ -28,6 +38,7 @@ struct YatteeApp: App {
|
||||
SettingsView()
|
||||
.environmentObject(AccountsModel())
|
||||
.environmentObject(InstancesModel())
|
||||
.environmentObject(updater)
|
||||
}
|
||||
#endif
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user