mirror of
https://github.com/openclaw/openclaw.git
synced 2026-05-05 05:00:21 +00:00
chore: Enable "curly" rule to avoid single-statement if confusion/errors.
This commit is contained in:
@@ -11,7 +11,9 @@ const log = createSubsystemLogger("telegram/network");
|
||||
// See: https://github.com/nodejs/node/issues/54359
|
||||
function applyTelegramNetworkWorkarounds(network?: TelegramNetworkConfig): void {
|
||||
const decision = resolveTelegramAutoSelectFamilyDecision({ network });
|
||||
if (decision.value === null || decision.value === appliedAutoSelectFamily) return;
|
||||
if (decision.value === null || decision.value === appliedAutoSelectFamily) {
|
||||
return;
|
||||
}
|
||||
appliedAutoSelectFamily = decision.value;
|
||||
|
||||
if (typeof net.setDefaultAutoSelectFamily === "function") {
|
||||
@@ -31,7 +33,9 @@ export function resolveTelegramFetch(
|
||||
options?: { network?: TelegramNetworkConfig },
|
||||
): typeof fetch | undefined {
|
||||
applyTelegramNetworkWorkarounds(options?.network);
|
||||
if (proxyFetch) return resolveFetch(proxyFetch);
|
||||
if (proxyFetch) {
|
||||
return resolveFetch(proxyFetch);
|
||||
}
|
||||
const fetchImpl = resolveFetch();
|
||||
if (!fetchImpl) {
|
||||
throw new Error("fetch is not available; set channels.telegram.proxy in config");
|
||||
|
||||
Reference in New Issue
Block a user