From f8de78210b2f6e9adf68a12d991194c95a4702b0 Mon Sep 17 00:00:00 2001 From: Max Goedjen Date: Sun, 10 Aug 2025 14:34:29 -0700 Subject: [PATCH] Fix preview. --- Sources/Secretive/Views/ContentView.swift | 58 ++++++++--------------- 1 file changed, 21 insertions(+), 37 deletions(-) diff --git a/Sources/Secretive/Views/ContentView.swift b/Sources/Secretive/Views/ContentView.swift index 2e486e1..8bcbe0a 100644 --- a/Sources/Secretive/Views/ContentView.swift +++ b/Sources/Secretive/Views/ContentView.swift @@ -193,41 +193,25 @@ extension ContentView { } -//#if DEBUG -// -//struct ContentView_Previews: PreviewProvider { -// -// private static let storeList: SecretStoreList = { -// let list = SecretStoreList() -// list.add(store: SecureEnclave.Store()) -// list.add(store: SmartCard.Store()) -// return list -// }() -// private static let agentStatusChecker = AgentStatusChecker() -// private static let justUpdatedChecker = JustUpdatedChecker() -// -// @State var hasRunSetup = false -// @State private var showingSetup = false -// @State private var showingCreation = false -// -// static var previews: some View { -// Group { -// // Empty on modifiable and nonmodifiable -// ContentView(showingCreation: .constant(false), runningSetup: .constant(false), hasRunSetup: .constant(true)) -// .environmentObject(Preview.storeList(stores: [Preview.Store(numberOfRandomSecrets: 0)], modifiableStores: [Preview.StoreModifiable(numberOfRandomSecrets: 0)])) -// .environmentObject(PreviewUpdater()) -// .environmentObject(agentStatusChecker) -// -// // 5 items on modifiable and nonmodifiable -// ContentView(showingCreation: .constant(false), runningSetup: .constant(false), hasRunSetup: .constant(true)) -// .environmentObject(Preview.storeList(stores: [Preview.Store()], modifiableStores: [Preview.StoreModifiable()])) -// .environmentObject(PreviewUpdater()) -// .environmentObject(agentStatusChecker) -// } -// .environmentObject(agentStatusChecker) -// -// } -//} -// -//#endif +#if DEBUG + +struct ContentView_Previews: PreviewProvider { + + static var previews: some View { + Group { + // Empty on modifiable and nonmodifiable + ContentView(showingCreation: .constant(false), runningSetup: .constant(false), hasRunSetup: .constant(true)) + .environment(Preview.storeList(stores: [Preview.Store(numberOfRandomSecrets: 0)], modifiableStores: [Preview.StoreModifiable(numberOfRandomSecrets: 0)])) + .environment(PreviewUpdater()) + + // 5 items on modifiable and nonmodifiable + ContentView(showingCreation: .constant(false), runningSetup: .constant(false), hasRunSetup: .constant(true)) + .environment(Preview.storeList(stores: [Preview.Store()], modifiableStores: [Preview.StoreModifiable()])) + .environment(PreviewUpdater()) + } + + } +} + +#endif