mirror of
https://github.com/openclaw/openclaw.git
synced 2026-05-09 13:07:39 +00:00
chore: Enable "curly" rule to avoid single-statement if confusion/errors.
This commit is contained in:
@@ -11,7 +11,9 @@ const cache = new Map<ChannelId, ChannelOutboundAdapter>();
|
||||
let lastRegistry: PluginRegistry | null = null;
|
||||
|
||||
function ensureCacheForRegistry(registry: PluginRegistry | null) {
|
||||
if (registry === lastRegistry) return;
|
||||
if (registry === lastRegistry) {
|
||||
return;
|
||||
}
|
||||
cache.clear();
|
||||
lastRegistry = registry;
|
||||
}
|
||||
@@ -22,7 +24,9 @@ export async function loadChannelOutboundAdapter(
|
||||
const registry = getActivePluginRegistry();
|
||||
ensureCacheForRegistry(registry);
|
||||
const cached = cache.get(id);
|
||||
if (cached) return cached;
|
||||
if (cached) {
|
||||
return cached;
|
||||
}
|
||||
const pluginEntry = registry?.channels.find((entry) => entry.plugin.id === id);
|
||||
const outbound = pluginEntry?.plugin.outbound;
|
||||
if (outbound) {
|
||||
|
||||
Reference in New Issue
Block a user