refactor: use consistent return type in handleMissingCustomSources
This commit is contained in:
parent
09538099d7
commit
053840d755
|
|
@ -2596,18 +2596,7 @@ If AgentVibes party mode is enabled, immediately trigger TTS with agent's voice:
|
||||||
installedModules,
|
installedModules,
|
||||||
);
|
);
|
||||||
|
|
||||||
// Handle both old return format (array) and new format (object)
|
const { validCustomModules, keptModulesWithoutSources } = customModuleResult;
|
||||||
let validCustomModules = [];
|
|
||||||
let keptModulesWithoutSources = [];
|
|
||||||
|
|
||||||
if (Array.isArray(customModuleResult)) {
|
|
||||||
// Old format - just an array
|
|
||||||
validCustomModules = customModuleResult;
|
|
||||||
} else if (customModuleResult && typeof customModuleResult === 'object') {
|
|
||||||
// New format - object with two arrays
|
|
||||||
validCustomModules = customModuleResult.validCustomModules || [];
|
|
||||||
keptModulesWithoutSources = customModuleResult.keptModulesWithoutSources || [];
|
|
||||||
}
|
|
||||||
|
|
||||||
const customModulesFromManifest = validCustomModules.map((m) => ({
|
const customModulesFromManifest = validCustomModules.map((m) => ({
|
||||||
...m,
|
...m,
|
||||||
|
|
@ -3386,7 +3375,10 @@ If AgentVibes party mode is enabled, immediately trigger TTS with agent's voice:
|
||||||
|
|
||||||
// If no missing sources, return immediately
|
// If no missing sources, return immediately
|
||||||
if (customModulesWithMissingSources.length === 0) {
|
if (customModulesWithMissingSources.length === 0) {
|
||||||
return validCustomModules;
|
return {
|
||||||
|
validCustomModules,
|
||||||
|
keptModulesWithoutSources: [],
|
||||||
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
// Stop any spinner for interactive prompts
|
// Stop any spinner for interactive prompts
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue