aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAlessio Nossa <alessio.nossa@gmail.com>2024-02-28 00:12:14 +0100
committerAlessio Nossa <alessio.nossa@gmail.com>2024-02-28 00:36:17 +0100
commit7abdf6eaf2ffd3c90a2d5fa6606777b8e18ea324 (patch)
tree61a080ae0d1ff7523cc3c0ae3dcda4e4fdb18169
parentWireguardApp: macOS: Add App Intents to macOS app (diff)
downloadwireguard-apple-7abdf6eaf2ffd3c90a2d5fa6606777b8e18ea324.tar.xz
wireguard-apple-7abdf6eaf2ffd3c90a2d5fa6606777b8e18ea324.zip
Fix return value of AppIntents in iOS 17
Signed-off-by: Alessio Nossa <alessio.nossa@gmail.com>
-rw-r--r--Sources/WireguardAppIntents/BuildPeerConfigurationUpdate.swift2
-rw-r--r--Sources/WireguardAppIntents/GetPeers.swift2
2 files changed, 2 insertions, 2 deletions
diff --git a/Sources/WireguardAppIntents/BuildPeerConfigurationUpdate.swift b/Sources/WireguardAppIntents/BuildPeerConfigurationUpdate.swift
index d6c0032..090e52a 100644
--- a/Sources/WireguardAppIntents/BuildPeerConfigurationUpdate.swift
+++ b/Sources/WireguardAppIntents/BuildPeerConfigurationUpdate.swift
@@ -23,7 +23,7 @@ struct BuildPeerConfigurationUpdate: AppIntent {
)
var endpoint: String
- func perform() async throws -> some IntentResult {
+ func perform() async throws -> some IntentResult & ReturnsValue<AppIntentsPeer> {
let peerConfigurationUpdate = AppIntentsPeer()
peerConfigurationUpdate.publicKey = publicKey
peerConfigurationUpdate.endpoint = endpoint
diff --git a/Sources/WireguardAppIntents/GetPeers.swift b/Sources/WireguardAppIntents/GetPeers.swift
index ce6849e..00e5399 100644
--- a/Sources/WireguardAppIntents/GetPeers.swift
+++ b/Sources/WireguardAppIntents/GetPeers.swift
@@ -21,7 +21,7 @@ struct GetPeers: AppIntent {
@Dependency
var tunnelsManager: TunnelsManager
- func perform() async throws -> some ReturnsValue {
+ func perform() async throws -> some IntentResult & ReturnsValue<[String]> {
guard let tunnelContainer = tunnelsManager.tunnel(named: tunnelName) else {
throw GetPeersIntentError.wrongTunnel(name: tunnelName)
}