mirror of
https://github.com/openclaw/openclaw.git
synced 2026-04-24 23:51:48 +00:00
fix(cron): allow clearing accountId and treat undefined global mode as announce
- UI: always include accountId in patch so users can clear it - delivery.ts: treat undefined global mode as announce when comparing for clearing inherited 'to'
This commit is contained in:
committed by
Tak Hoffman
parent
62f71fa401
commit
bf86d07e70
@@ -171,7 +171,9 @@ export function resolveFailureDestination(
|
||||
// Mode was explicitly overridden - clear inherited 'to' since URL semantics differ
|
||||
// between announce (channel recipient) and webhook (HTTP endpoint)
|
||||
// But preserve explicit 'to' that was set at job level
|
||||
if (!jobToExplicit && globalConfig?.mode !== jobMode) {
|
||||
// Treat undefined global mode as "announce" for comparison
|
||||
const globalMode = globalConfig?.mode ?? "announce";
|
||||
if (!jobToExplicit && globalMode !== jobMode) {
|
||||
to = undefined;
|
||||
}
|
||||
mode = jobMode;
|
||||
|
||||
@@ -606,12 +606,13 @@ function buildFailureAlert(form: CronFormState) {
|
||||
channel: form.failureAlertChannel.trim() || CRON_CHANNEL_LAST,
|
||||
to: form.failureAlertTo.trim() || undefined,
|
||||
...(cooldownMs !== undefined ? { cooldownMs } : {}),
|
||||
...(accountId ? { accountId } : {}),
|
||||
};
|
||||
// Always include mode so users can switch between webhook/announce
|
||||
// Always include mode and accountId so users can switch/clear them
|
||||
if (deliveryMode) {
|
||||
patch.mode = deliveryMode;
|
||||
}
|
||||
// Include accountId if explicitly set, or send undefined to allow clearing
|
||||
patch.accountId = accountId || undefined;
|
||||
return patch;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user