refactor: improve alert error context and copy action
This commit is contained in:
@@ -26,7 +26,7 @@ public struct InstallProfileButton: View {
|
||||
try await ExtensionProfile.install()
|
||||
await callback()
|
||||
} catch {
|
||||
alert = AlertState(error: error)
|
||||
alert = AlertState(action: "install network extension", error: error)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -31,7 +31,7 @@
|
||||
}
|
||||
await callback()
|
||||
} catch {
|
||||
alert = AlertState(error: error)
|
||||
alert = AlertState(action: "install system extension", error: error)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -165,7 +165,8 @@ public struct StartStopButton: View {
|
||||
} catch {
|
||||
await MainActor.run {
|
||||
isStarting = false
|
||||
alert = AlertState(error: error)
|
||||
let action = isEnabled ? "start service" : "stop service"
|
||||
alert = AlertState(action: action, error: error)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user