mirror of
https://github.com/metabolist/metatext.git
synced 2024-11-26 02:01:00 +00:00
31 lines
850 B
Swift
31 lines
850 B
Swift
// Copyright © 2020 Metabolist. All rights reserved.
|
|
|
|
import SwiftUI
|
|
|
|
@main
|
|
struct MetatextApp: App {
|
|
private let environment: AppEnvironment
|
|
|
|
init() {
|
|
let identityDatabase: IdentityDatabase
|
|
|
|
do {
|
|
try identityDatabase = IdentityDatabase()
|
|
} catch {
|
|
fatalError("Failed to initialize identity database")
|
|
}
|
|
|
|
environment = AppEnvironment(
|
|
URLSessionConfiguration: .default,
|
|
identityDatabase: identityDatabase,
|
|
defaults: Defaults(userDefaults: .standard),
|
|
secrets: Secrets(keychain: Keychain(service: "com.metabolist.metatext")),
|
|
webAuthSessionType: RealWebAuthSession.self)
|
|
}
|
|
|
|
var body: some Scene {
|
|
WindowGroup {
|
|
RootView(viewModel: RootViewModel(environment: environment))
|
|
}
|
|
}
|
|
}
|