mirror of
https://github.com/metabolist/metatext.git
synced 2025-02-16 22:15:14 +00:00
34 lines
942 B
Swift
34 lines
942 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(
|
|
identityDatabase: identityDatabase,
|
|
preferences: Preferences(userDefaults: .standard),
|
|
secrets: Secrets(keychain: Keychain(service: "com.metabolist.metatext")),
|
|
webAuthSessionType: RealWebAuthSession.self)
|
|
}
|
|
|
|
var body: some Scene {
|
|
WindowGroup {
|
|
ContentView()
|
|
.environmentObject(
|
|
SceneViewModel(
|
|
networkClient: MastodonClient(),
|
|
environment: environment))
|
|
}
|
|
}
|
|
}
|