mirror of
https://github.com/maxgoedjen/secretive.git
synced 2026-03-10 19:47:24 +01:00
XPC scaffolding
This commit is contained in:
@@ -87,7 +87,7 @@ extension ContentView {
|
||||
})
|
||||
.popover(isPresented: $showingCreation, attachmentAnchor: .point(.bottom), arrowEdge: .bottom) {
|
||||
if let modifiable = storeList.modifiableStore {
|
||||
CreateSecretView(store: modifiable, showing: $showingCreation)
|
||||
CreateSecretView<AnySecretStoreModifiable, AgentCommunicationController>(store: modifiable, showing: $showingCreation)
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -1,9 +1,10 @@
|
||||
import SwiftUI
|
||||
import SecretKit
|
||||
|
||||
struct CreateSecretView<StoreType: SecretStoreModifiable>: View {
|
||||
struct CreateSecretView<StoreType: SecretStoreModifiable, AgentCommunicationControllerType: AgentCommunicationControllerProtocol>: View {
|
||||
|
||||
@ObservedObject var store: StoreType
|
||||
@EnvironmentObject private var agentCommunicationController: AgentCommunicationControllerType
|
||||
@Binding var showing: Bool
|
||||
|
||||
@State private var name = ""
|
||||
@@ -52,6 +53,9 @@ struct CreateSecretView<StoreType: SecretStoreModifiable>: View {
|
||||
|
||||
func save() {
|
||||
try! store.create(name: name, requiresAuthentication: requiresAuthentication)
|
||||
Task {
|
||||
try! await agentCommunicationController.agent.updatedStore(withID: store.id)
|
||||
}
|
||||
showing = false
|
||||
}
|
||||
}
|
||||
|
||||
@@ -156,7 +156,7 @@ struct SecretAgentSetupView: View {
|
||||
}
|
||||
|
||||
func install() {
|
||||
LaunchAgentController().install()
|
||||
AgentLaunchController().install()
|
||||
buttonAction()
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user