Files
openclaw/apps/macos/Sources/OpenClaw/CronSettings+Actions.swift

24 lines
673 B
Swift
Raw Normal View History

2025-12-24 19:36:10 +01:00
import Foundation
import OpenClawProtocol
2025-12-24 19:36:10 +01:00
extension CronSettings {
func save(payload: [String: AnyCodable]) async {
guard !self.isSaving else { return }
self.isSaving = true
self.editorError = nil
do {
try await self.store.upsertJob(id: self.editingJob?.id, payload: payload)
await MainActor.run {
self.isSaving = false
self.showEditor = false
self.editingJob = nil
}
} catch {
await MainActor.run {
self.isSaving = false
self.editorError = error.localizedDescription
}
}
}
}