mirror of
https://github.com/openclaw/openclaw.git
synced 2026-05-09 22:14:34 +00:00
chore: Enable "curly" rule to avoid single-statement if confusion/errors.
This commit is contained in:
@@ -184,7 +184,9 @@ export function resolveHeartbeatDeliveryTarget(params: {
|
||||
target = rawTarget;
|
||||
} else if (typeof rawTarget === "string") {
|
||||
const normalized = normalizeChannelId(rawTarget);
|
||||
if (normalized) target = normalized;
|
||||
if (normalized) {
|
||||
target = normalized;
|
||||
}
|
||||
}
|
||||
|
||||
if (target === "none") {
|
||||
@@ -279,12 +281,16 @@ function resolveHeartbeatSenderId(params: {
|
||||
}
|
||||
if (candidates.length > 0 && allowList.length > 0) {
|
||||
const matched = candidates.find((candidate) => allowList.includes(candidate));
|
||||
if (matched) return matched;
|
||||
if (matched) {
|
||||
return matched;
|
||||
}
|
||||
}
|
||||
if (candidates.length > 0 && allowList.length === 0) {
|
||||
return candidates[0];
|
||||
}
|
||||
if (allowList.length > 0) return allowList[0];
|
||||
if (allowList.length > 0) {
|
||||
return allowList[0];
|
||||
}
|
||||
return candidates[0] ?? "heartbeat";
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user