mirror of
https://github.com/openclaw/openclaw.git
synced 2026-04-17 20:21:13 +00:00
refactor: dedupe infra lowercase helpers
This commit is contained in:
@@ -9,6 +9,7 @@ import {
|
||||
} from "../infra/device-pairing.js";
|
||||
import { formatTimeAgo } from "../infra/format-time/format-relative.ts";
|
||||
import { defaultRuntime } from "../runtime.js";
|
||||
import { normalizeLowercaseStringOrEmpty } from "../shared/string-coerce.js";
|
||||
import { getTerminalTableWidth, renderTable } from "../terminal/table.js";
|
||||
import { theme } from "../terminal/theme.js";
|
||||
import { GATEWAY_CLIENT_MODES, GATEWAY_CLIENT_NAMES } from "../utils/message-channel.js";
|
||||
@@ -100,7 +101,7 @@ function normalizeErrorMessage(error: unknown): string {
|
||||
}
|
||||
|
||||
function shouldUseLocalPairingFallback(opts: DevicesRpcOpts, error: unknown): boolean {
|
||||
const message = normalizeErrorMessage(error).toLowerCase();
|
||||
const message = normalizeLowercaseStringOrEmpty(normalizeErrorMessage(error));
|
||||
if (!message.includes("pairing required")) {
|
||||
return false;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user