mirror of
https://github.com/maxgoedjen/secretive.git
synced 2026-03-07 10:17:22 +01:00
Fix bug where agent could relaunch after being disabled (#743)
This commit is contained in:
@@ -15,6 +15,7 @@ struct AgentStatusView: View {
|
||||
struct AgentRunningView: View {
|
||||
|
||||
@Environment(\.agentLaunchController) private var agentLaunchController: any AgentLaunchControllerProtocol
|
||||
@AppStorage("explicitlyDisabled") var explicitlyDisabled = false
|
||||
|
||||
var body: some View {
|
||||
Form {
|
||||
@@ -53,6 +54,7 @@ struct AgentRunningView: View {
|
||||
Menu(.agentDetailsRestartAgentButton) {
|
||||
Button(.agentDetailsDisableAgentButton) {
|
||||
Task {
|
||||
explicitlyDisabled = true
|
||||
try? await agentLaunchController
|
||||
.uninstall()
|
||||
}
|
||||
@@ -79,6 +81,7 @@ struct AgentNotRunningView: View {
|
||||
@Environment(\.agentLaunchController) private var agentLaunchController
|
||||
@State var triedRestart = false
|
||||
@State var loading = false
|
||||
@AppStorage("explicitlyDisabled") var explicitlyDisabled = false
|
||||
|
||||
var body: some View {
|
||||
Form {
|
||||
@@ -94,6 +97,7 @@ struct AgentNotRunningView: View {
|
||||
if !triedRestart {
|
||||
Spacer()
|
||||
Button {
|
||||
explicitlyDisabled = false
|
||||
guard !loading else { return }
|
||||
loading = true
|
||||
Task {
|
||||
|
||||
Reference in New Issue
Block a user