2020-07-19 02:12:32 +00:00
|
|
|
// Copyright © 2020 Metabolist. All rights reserved.
|
2020-07-19 02:06:12 +00:00
|
|
|
|
|
|
|
import SwiftUI
|
|
|
|
|
|
|
|
@main
|
|
|
|
struct MetatextApp: App {
|
2020-08-09 11:27:38 +00:00
|
|
|
private let identityDatabase: IdentityDatabase
|
|
|
|
private let keychainServive = KeychainService(serviceName: "com.metabolist.metatext")
|
|
|
|
private let environment = AppEnvironment(
|
|
|
|
URLSessionConfiguration: .default,
|
|
|
|
webAuthSessionType: WebAuthSession.self)
|
2020-07-29 23:50:30 +00:00
|
|
|
|
|
|
|
init() {
|
|
|
|
do {
|
|
|
|
try identityDatabase = IdentityDatabase()
|
|
|
|
} catch {
|
|
|
|
fatalError("Failed to initialize identity database")
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2020-07-19 02:06:12 +00:00
|
|
|
var body: some Scene {
|
|
|
|
WindowGroup {
|
2020-08-09 11:27:38 +00:00
|
|
|
RootView(
|
|
|
|
viewModel: RootViewModel(identitiesService: IdentitiesService(
|
|
|
|
identityDatabase: identityDatabase,
|
|
|
|
keychainService: keychainServive,
|
|
|
|
environment: environment)))
|
2020-07-19 02:06:12 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
2020-08-09 02:52:41 +00:00
|
|
|
|
|
|
|
private extension MetatextApp {
|
|
|
|
static let keychainServiceName = "com.metabolist.metatext"
|
|
|
|
}
|