修复快捷指令运行时崩溃

This commit is contained in:
2026-07-15 22:40:19 +08:00
parent adf13ae47c
commit 10ba84e349
+3 -3
View File
@@ -25,13 +25,13 @@ struct SaveClipIntent: AppIntent {
self.source = source
}
func perform() async throws -> some IntentResult {
func perform() async throws -> some IntentResult & ReturnsValue<String> {
let trimmed = text.trimmingCharacters(in: .whitespacesAndNewlines)
guard !trimmed.isEmpty else {
return .result(dialog: "文案为空,未保存。")
return .result(value: "文案为空,未保存。")
}
try await ClipStore.shared.save(text: trimmed, source: source)
return .result(dialog: "已保存到收集箱。")
return .result(value: "已保存到收集箱。")
}
}