1
0
mirror of https://github.com/yattee/yattee.git synced 2024-12-13 22:00:31 +05:30
yattee/Shared/YatteeApp.swift

35 lines
858 B
Swift
Raw Normal View History

2021-09-25 13:48:22 +05:30
import Defaults
2021-06-10 02:21:23 +05:30
import SwiftUI
@main
2021-11-07 19:02:01 +05:30
struct YatteeApp: App {
2021-10-24 14:46:04 +05:30
#if os(macOS)
@NSApplicationDelegateAdaptor(AppDelegate.self) var appDelegate
#endif
2021-11-09 04:44:28 +05:30
@StateObject private var menu = MenuModel()
2021-06-10 02:21:23 +05:30
var body: some Scene {
WindowGroup {
ContentView()
2021-11-09 04:44:28 +05:30
.environmentObject(menu)
2021-06-10 02:21:23 +05:30
}
2021-07-28 04:10:04 +05:30
#if !os(tvOS)
2021-11-08 21:59:35 +05:30
.handlesExternalEvents(matching: Set(["*"]))
.commands {
SidebarCommands()
CommandGroup(replacing: .newItem, addition: {})
2021-11-09 04:44:28 +05:30
MenuCommands(model: Binding<MenuModel>(get: { menu }, set: { _ in }))
2021-11-08 21:59:35 +05:30
}
2021-07-28 04:10:04 +05:30
#endif
2021-09-25 13:48:22 +05:30
#if os(macOS)
Settings {
SettingsView()
2021-11-13 02:16:15 +05:30
.environmentObject(AccountsModel())
.environmentObject(InstancesModel())
2021-09-25 13:48:22 +05:30
}
#endif
}
2021-06-10 02:21:23 +05:30
}