mirror of
https://github.com/maxgoedjen/secretive.git
synced 2026-03-05 09:24:49 +01:00
Availibilty
This commit is contained in:
@@ -27,10 +27,12 @@ class AppDelegate: NSObject, NSApplicationDelegate {
|
||||
window.makeKeyAndOrderFront(nil)
|
||||
window.titleVisibility = .hidden
|
||||
window.toolbar = toolbar
|
||||
let plus = NSTitlebarAccessoryViewController()
|
||||
plus.view = NSButton(image: NSImage(named: NSImage.addTemplateName)!, target: self, action: #selector(add(sender:)))
|
||||
plus.layoutAttribute = .right
|
||||
window.addTitlebarAccessoryViewController(plus)
|
||||
if secureEnclave.isAvailable {
|
||||
let plus = NSTitlebarAccessoryViewController()
|
||||
plus.view = NSButton(image: NSImage(named: NSImage.addTemplateName)!, target: self, action: #selector(add(sender:)))
|
||||
plus.layoutAttribute = .right
|
||||
window.addTitlebarAccessoryViewController(plus)
|
||||
}
|
||||
runSetupIfNeeded()
|
||||
}
|
||||
|
||||
|
||||
@@ -13,21 +13,25 @@ struct ContentView: View {
|
||||
var body: some View {
|
||||
NavigationView {
|
||||
List(selection: $active) {
|
||||
Section(header: Text(secureEnclave.name)) {
|
||||
ForEach(secureEnclave.secrets) { secret in
|
||||
NavigationLink(destination: SecretDetailView(secret: secret), tag: secret.id, selection: self.$active) {
|
||||
Text(secret.name)
|
||||
}.contextMenu {
|
||||
Button(action: { self.delete(secret: secret) }) {
|
||||
Text("Delete")
|
||||
if secureEnclave.isAvailable {
|
||||
Section(header: Text(secureEnclave.name)) {
|
||||
ForEach(secureEnclave.secrets) { secret in
|
||||
NavigationLink(destination: SecretDetailView(secret: secret), tag: secret.id, selection: self.$active) {
|
||||
Text(secret.name)
|
||||
}.contextMenu {
|
||||
Button(action: { self.delete(secret: secret) }) {
|
||||
Text("Delete")
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
Section(header: Text(smartCard.name)) {
|
||||
ForEach(smartCard.secrets) { secret in
|
||||
NavigationLink(destination: SecretDetailView(secret: secret), tag: secret.id, selection: self.$active) {
|
||||
Text(secret.name)
|
||||
if smartCard.isAvailable {
|
||||
Section(header: Text(smartCard.name)) {
|
||||
ForEach(smartCard.secrets) { secret in
|
||||
NavigationLink(destination: SecretDetailView(secret: secret), tag: secret.id, selection: self.$active) {
|
||||
Text(secret.name)
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -19,6 +19,7 @@ extension Preview {
|
||||
|
||||
class Store: SecretStore, ObservableObject {
|
||||
|
||||
let isAvailable = true
|
||||
let name = "Preview Store"
|
||||
@Published var secrets: [Secret] = []
|
||||
|
||||
|
||||
Reference in New Issue
Block a user