mirror of
https://github.com/openclaw/openclaw.git
synced 2026-04-25 08:02:04 +00:00
fix: align feishu and matrix type guards
This commit is contained in:
@@ -39,9 +39,9 @@ function getScopedFeishuConfig(
|
||||
): FeishuConfig | FeishuAccountConfig {
|
||||
const feishuCfg = ((cfg.channels?.feishu as FeishuConfig | undefined) ?? {}) as FeishuConfig;
|
||||
if (accountId === DEFAULT_ACCOUNT_ID) {
|
||||
return feishuCfg ?? {};
|
||||
return feishuCfg;
|
||||
}
|
||||
return (feishuCfg?.accounts?.[accountId] as FeishuAccountConfig | undefined) ?? {};
|
||||
return (feishuCfg.accounts?.[accountId] as FeishuAccountConfig | undefined) ?? {};
|
||||
}
|
||||
|
||||
function patchFeishuConfig(
|
||||
|
||||
@@ -54,6 +54,15 @@ function countMatrixExecApprovalEligibleAccounts(params: {
|
||||
cfg: params.cfg,
|
||||
accountId,
|
||||
});
|
||||
const filters = config?.enabled
|
||||
? {
|
||||
agentFilter: config.agentFilter,
|
||||
sessionFilter: config.sessionFilter,
|
||||
}
|
||||
: {
|
||||
agentFilter: undefined,
|
||||
sessionFilter: undefined,
|
||||
};
|
||||
return (
|
||||
isChannelExecApprovalClientEnabledFromConfig({
|
||||
enabled: config?.enabled,
|
||||
@@ -63,6 +72,8 @@ function countMatrixExecApprovalEligibleAccounts(params: {
|
||||
request: params.request.request,
|
||||
agentFilter: config?.agentFilter,
|
||||
sessionFilter: config?.sessionFilter,
|
||||
agentFilter: filters.agentFilter,
|
||||
sessionFilter: filters.sessionFilter,
|
||||
})
|
||||
);
|
||||
}).length;
|
||||
|
||||
Reference in New Issue
Block a user