mirror of
https://github.com/openclaw/openclaw.git
synced 2026-05-06 12:01:38 +00:00
chore: Enable "curly" rule to avoid single-statement if confusion/errors.
This commit is contained in:
@@ -25,7 +25,9 @@ export function createBlockReplyCoalescer(params: {
|
||||
let idleTimer: NodeJS.Timeout | undefined;
|
||||
|
||||
const clearIdleTimer = () => {
|
||||
if (!idleTimer) return;
|
||||
if (!idleTimer) {
|
||||
return;
|
||||
}
|
||||
clearTimeout(idleTimer);
|
||||
idleTimer = undefined;
|
||||
};
|
||||
@@ -37,7 +39,9 @@ export function createBlockReplyCoalescer(params: {
|
||||
};
|
||||
|
||||
const scheduleIdleFlush = () => {
|
||||
if (idleMs <= 0) return;
|
||||
if (idleMs <= 0) {
|
||||
return;
|
||||
}
|
||||
clearIdleTimer();
|
||||
idleTimer = setTimeout(() => {
|
||||
void flush({ force: false });
|
||||
@@ -50,7 +54,9 @@ export function createBlockReplyCoalescer(params: {
|
||||
resetBuffer();
|
||||
return;
|
||||
}
|
||||
if (!bufferText) return;
|
||||
if (!bufferText) {
|
||||
return;
|
||||
}
|
||||
if (!options?.force && bufferText.length < minChars) {
|
||||
scheduleIdleFlush();
|
||||
return;
|
||||
@@ -65,7 +71,9 @@ export function createBlockReplyCoalescer(params: {
|
||||
};
|
||||
|
||||
const enqueue = (payload: ReplyPayload) => {
|
||||
if (shouldAbort()) return;
|
||||
if (shouldAbort()) {
|
||||
return;
|
||||
}
|
||||
const hasMedia = Boolean(payload.mediaUrl) || (payload.mediaUrls?.length ?? 0) > 0;
|
||||
const text = payload.text ?? "";
|
||||
const hasText = text.trim().length > 0;
|
||||
@@ -74,7 +82,9 @@ export function createBlockReplyCoalescer(params: {
|
||||
void onFlush(payload);
|
||||
return;
|
||||
}
|
||||
if (!hasText) return;
|
||||
if (!hasText) {
|
||||
return;
|
||||
}
|
||||
|
||||
if (
|
||||
bufferText &&
|
||||
|
||||
Reference in New Issue
Block a user