Whitespace

This commit is contained in:
Max Goedjen 2021-12-31 14:54:40 -08:00
parent b8411008ae
commit 905a22ad50
No known key found for this signature in database
GPG Key ID: E58C21DD77B9B8E8
1 changed files with 16 additions and 16 deletions

View File

@ -3,18 +3,18 @@ import SecretKit
import Brief import Brief
struct ContentView<UpdaterType: UpdaterProtocol, AgentStatusCheckerType: AgentStatusCheckerProtocol>: View { struct ContentView<UpdaterType: UpdaterProtocol, AgentStatusCheckerType: AgentStatusCheckerProtocol>: View {
@Binding var showingCreation: Bool @Binding var showingCreation: Bool
@Binding var runningSetup: Bool @Binding var runningSetup: Bool
@Binding var hasRunSetup: Bool @Binding var hasRunSetup: Bool
@EnvironmentObject private var storeList: SecretStoreList @EnvironmentObject private var storeList: SecretStoreList
@EnvironmentObject private var updater: UpdaterType @EnvironmentObject private var updater: UpdaterType
@EnvironmentObject private var agentStatusChecker: AgentStatusCheckerType @EnvironmentObject private var agentStatusChecker: AgentStatusCheckerType
@State private var selectedUpdate: Release? @State private var selectedUpdate: Release?
@State private var showingAppPathNotice = false @State private var showingAppPathNotice = false
var body: some View { var body: some View {
VStack { VStack {
if storeList.anyAvailable { if storeList.anyAvailable {
@ -31,11 +31,11 @@ struct ContentView<UpdaterType: UpdaterProtocol, AgentStatusCheckerType: AgentSt
newItem newItem
} }
} }
} }
extension ContentView { extension ContentView {
var updateNotice: ToolbarItem<Void, AnyView> { var updateNotice: ToolbarItem<Void, AnyView> {
guard let update = updater.update else { guard let update = updater.update else {
return ToolbarItem { AnyView(EmptyView()) } return ToolbarItem { AnyView(EmptyView()) }
@ -71,7 +71,7 @@ extension ContentView {
) )
} }
} }
var newItem: ToolbarItem<Void, AnyView> { var newItem: ToolbarItem<Void, AnyView> {
guard storeList.modifiableStore?.isAvailable ?? false else { guard storeList.modifiableStore?.isAvailable ?? false else {
return ToolbarItem { AnyView(EmptyView()) } return ToolbarItem { AnyView(EmptyView()) }
@ -88,11 +88,11 @@ extension ContentView {
CreateSecretView(store: modifiable, showing: $showingCreation) CreateSecretView(store: modifiable, showing: $showingCreation)
} }
} }
) )
} }
} }
var setupNotice: ToolbarItem<Void, AnyView> { var setupNotice: ToolbarItem<Void, AnyView> {
return ToolbarItem { return ToolbarItem {
AnyView( AnyView(
@ -123,7 +123,7 @@ extension ContentView {
) )
} }
} }
var appPathNotice: ToolbarItem<Void, AnyView> { var appPathNotice: ToolbarItem<Void, AnyView> {
let controller = ApplicationDirectoryController() let controller = ApplicationDirectoryController()
guard !controller.isInApplicationsDirectory else { guard !controller.isInApplicationsDirectory else {
@ -156,13 +156,13 @@ extension ContentView {
) )
} }
} }
} }
#if DEBUG #if DEBUG
struct ContentView_Previews: PreviewProvider { struct ContentView_Previews: PreviewProvider {
private static let storeList: SecretStoreList = { private static let storeList: SecretStoreList = {
let list = SecretStoreList() let list = SecretStoreList()
list.add(store: SecureEnclave.Store()) list.add(store: SecureEnclave.Store())
@ -171,11 +171,11 @@ struct ContentView_Previews: PreviewProvider {
}() }()
private static let agentStatusChecker = AgentStatusChecker() private static let agentStatusChecker = AgentStatusChecker()
private static let justUpdatedChecker = JustUpdatedChecker() private static let justUpdatedChecker = JustUpdatedChecker()
@State var hasRunSetup = false @State var hasRunSetup = false
@State private var showingSetup = false @State private var showingSetup = false
@State private var showingCreation = false @State private var showingCreation = false
static var previews: some View { static var previews: some View {
Group { Group {
// Empty on modifiable and nonmodifiable // Empty on modifiable and nonmodifiable
@ -183,7 +183,7 @@ struct ContentView_Previews: PreviewProvider {
.environmentObject(Preview.storeList(stores: [Preview.Store(numberOfRandomSecrets: 0)], modifiableStores: [Preview.StoreModifiable(numberOfRandomSecrets: 0)])) .environmentObject(Preview.storeList(stores: [Preview.Store(numberOfRandomSecrets: 0)], modifiableStores: [Preview.StoreModifiable(numberOfRandomSecrets: 0)]))
.environmentObject(PreviewUpdater()) .environmentObject(PreviewUpdater())
.environmentObject(agentStatusChecker) .environmentObject(agentStatusChecker)
// 5 items on modifiable and nonmodifiable // 5 items on modifiable and nonmodifiable
ContentView<PreviewUpdater, AgentStatusChecker>(showingCreation: .constant(false), runningSetup: .constant(false), hasRunSetup: .constant(true)) ContentView<PreviewUpdater, AgentStatusChecker>(showingCreation: .constant(false), runningSetup: .constant(false), hasRunSetup: .constant(true))
.environmentObject(Preview.storeList(stores: [Preview.Store()], modifiableStores: [Preview.StoreModifiable()])) .environmentObject(Preview.storeList(stores: [Preview.Store()], modifiableStores: [Preview.StoreModifiable()]))
@ -191,7 +191,7 @@ struct ContentView_Previews: PreviewProvider {
.environmentObject(agentStatusChecker) .environmentObject(agentStatusChecker)
} }
.environmentObject(agentStatusChecker) .environmentObject(agentStatusChecker)
} }
} }