mirror of
https://github.com/maxgoedjen/secretive.git
synced 2025-09-20 03:10:57 +00:00
Cleanup.
This commit is contained in:
parent
e62ec94099
commit
10f279675a
@ -19,15 +19,8 @@ extension EnvironmentValues {
|
||||
@main
|
||||
struct Secretive: App {
|
||||
|
||||
private let storeList: SecretStoreList = {
|
||||
let list = SecretStoreList()
|
||||
list.add(store: SecureEnclave.Store())
|
||||
list.add(store: SmartCard.Store())
|
||||
return list
|
||||
}()
|
||||
private let agentStatusChecker = AgentStatusChecker()
|
||||
private let justUpdatedChecker = JustUpdatedChecker()
|
||||
|
||||
@Environment(\.agentStatusChecker) var agentStatusChecker
|
||||
@AppStorage("defaultsHasRunSetup") var hasRunSetup = false
|
||||
@State private var showingSetup = false
|
||||
@State private var showingCreation = false
|
||||
@ -35,9 +28,8 @@ struct Secretive: App {
|
||||
@SceneBuilder var body: some Scene {
|
||||
WindowGroup {
|
||||
ContentView(showingCreation: $showingCreation, runningSetup: $showingSetup, hasRunSetup: $hasRunSetup)
|
||||
.environment(storeList)
|
||||
// This one is explicitly injected via environment to support hasRunSetup.
|
||||
.environment(Updater(checkOnLaunch: hasRunSetup))
|
||||
.environment(agentStatusChecker)
|
||||
.onAppear {
|
||||
if !hasRunSetup {
|
||||
showingSetup = true
|
||||
|
@ -7,6 +7,7 @@ import Observation
|
||||
protocol AgentStatusCheckerProtocol: Observable {
|
||||
var running: Bool { get }
|
||||
var developmentBuild: Bool { get }
|
||||
func check()
|
||||
}
|
||||
|
||||
@Observable class AgentStatusChecker: AgentStatusCheckerProtocol {
|
||||
|
@ -10,4 +10,7 @@ class PreviewAgentStatusChecker: AgentStatusCheckerProtocol {
|
||||
self.running = running
|
||||
}
|
||||
|
||||
func check() {
|
||||
}
|
||||
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user