Remove one tag

This commit is contained in:
Max Goedjen 2020-03-07 13:43:57 -08:00
parent 9a40c8ea7e
commit fb752240b5
No known key found for this signature in database
GPG Key ID: E58C21DD77B9B8E8

View File

@ -4,28 +4,27 @@ import SecretKit
struct ContentView: View {
@ObservedObject var store: SecureEnclave.Store
@State var active: SecureEnclave.Secret?
@State var active: SecureEnclave.Secret.ID?
@State var showingDeletion = false
@State var deletingSecret: SecureEnclave.Secret?
var body: some View {
NavigationView {
List(selection: self.$active) {
List(selection: $active) {
Section(header: Text(store.name)) {
ForEach(store.secrets) { secret in
NavigationLink(destination: SecretDetailView(secret: secret), tag: secret, selection: self.$active) {
NavigationLink(destination: SecretDetailView(secret: secret), tag: secret.id, selection: self.$active) {
Text(secret.name)
}.contextMenu {
Button(action: { self.delete(secret: secret) }) {
Text("Delete")
}
}
.tag(secret)
}
}
}.onAppear {
self.active = self.store.secrets.first
self.active = self.store.secrets.first?.id
}
.listStyle(SidebarListStyle())
.frame(minWidth: 100, idealWidth: 240)