2020-07-19 04:12:32 +02:00
|
|
|
// Copyright © 2020 Metabolist. All rights reserved.
|
2020-07-19 04:06:12 +02:00
|
|
|
|
|
|
|
import SwiftUI
|
|
|
|
|
|
|
|
@main
|
|
|
|
struct MetatextApp: App {
|
2020-08-12 09:24:39 +02:00
|
|
|
// swiftlint:disable weak_delegate
|
|
|
|
#if os(macOS)
|
|
|
|
@NSApplicationDelegateAdaptor(AppDelegate.self) private var appDelegate
|
|
|
|
#else
|
|
|
|
@UIApplicationDelegateAdaptor(AppDelegate.self) private var appDelegate
|
|
|
|
#endif
|
|
|
|
// swiftlint:enable weak_delegate
|
|
|
|
|
|
|
|
private let identitiesService: IdentitiesService = {
|
|
|
|
let identityDatabase: IdentityDatabase
|
2020-07-30 01:50:30 +02:00
|
|
|
|
|
|
|
do {
|
|
|
|
try identityDatabase = IdentityDatabase()
|
|
|
|
} catch {
|
|
|
|
fatalError("Failed to initialize identity database")
|
|
|
|
}
|
2020-08-12 09:24:39 +02:00
|
|
|
|
|
|
|
return IdentitiesService(identityDatabase: identityDatabase, environment: .live)
|
|
|
|
}()
|
2020-07-30 01:50:30 +02:00
|
|
|
|
2020-07-19 04:06:12 +02:00
|
|
|
var body: some Scene {
|
|
|
|
WindowGroup {
|
2020-08-09 13:27:38 +02:00
|
|
|
RootView(
|
2020-08-12 09:24:39 +02:00
|
|
|
viewModel: RootViewModel(appDelegate: appDelegate,
|
|
|
|
identitiesService: identitiesService,
|
2020-08-13 12:18:21 +02:00
|
|
|
userNotificationService: UserNotificationService()))
|
2020-07-19 04:06:12 +02:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|