From 0eeab5023ff727892735ef7710610e912faad48a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E4=B8=96=E7=95=8C?= Date: Fri, 6 Oct 2023 18:27:59 +0800 Subject: [PATCH] Fix App Intents --- IntentsExtension/Intents.swift | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/IntentsExtension/Intents.swift b/IntentsExtension/Intents.swift index b4be32a..11a36c8 100644 --- a/IntentsExtension/Intents.swift +++ b/IntentsExtension/Intents.swift @@ -104,7 +104,7 @@ struct ToggleServiceIntent: AppIntent { Summary("Toggle sing-box service") } - func perform() async throws -> some IntentResult { + func perform() async throws -> some IntentResult & ReturnsValue { guard let extensionProfile = try await (ExtensionProfile.load()) else { return .result(value: false) } @@ -129,7 +129,7 @@ struct GetServiceStatus: AppIntent { Summary("Get is sing-box service started") } - func perform() async throws -> some IntentResult { + func perform() async throws -> some IntentResult & ReturnsValue { guard let extensionProfile = try await (ExtensionProfile.load()) else { return .result(value: false) } @@ -147,7 +147,7 @@ struct GetCurrentProfile: AppIntent { Summary("Get current sing-box profile") } - func perform() async throws -> some IntentResult { + func perform() async throws -> some IntentResult & ReturnsValue { guard let profile = try await ProfileManager.get(SharedPreferences.selectedProfileID.get()) else { throw NSError(domain: "No profile selected", code: 0) }