mirror of
https://github.com/openclaw/openclaw.git
synced 2026-05-04 16:20:21 +00:00
chore: Enable "curly" rule to avoid single-statement if confusion/errors.
This commit is contained in:
@@ -5,13 +5,19 @@ export function getCliSessionId(
|
||||
entry: SessionEntry | undefined,
|
||||
provider: string,
|
||||
): string | undefined {
|
||||
if (!entry) return undefined;
|
||||
if (!entry) {
|
||||
return undefined;
|
||||
}
|
||||
const normalized = normalizeProviderId(provider);
|
||||
const fromMap = entry.cliSessionIds?.[normalized];
|
||||
if (fromMap?.trim()) return fromMap.trim();
|
||||
if (fromMap?.trim()) {
|
||||
return fromMap.trim();
|
||||
}
|
||||
if (normalized === "claude-cli") {
|
||||
const legacy = entry.claudeCliSessionId?.trim();
|
||||
if (legacy) return legacy;
|
||||
if (legacy) {
|
||||
return legacy;
|
||||
}
|
||||
}
|
||||
return undefined;
|
||||
}
|
||||
@@ -19,7 +25,9 @@ export function getCliSessionId(
|
||||
export function setCliSessionId(entry: SessionEntry, provider: string, sessionId: string): void {
|
||||
const normalized = normalizeProviderId(provider);
|
||||
const trimmed = sessionId.trim();
|
||||
if (!trimmed) return;
|
||||
if (!trimmed) {
|
||||
return;
|
||||
}
|
||||
const existing = entry.cliSessionIds ?? {};
|
||||
entry.cliSessionIds = { ...existing };
|
||||
entry.cliSessionIds[normalized] = trimmed;
|
||||
|
||||
Reference in New Issue
Block a user