feat: Update Control Adapter Collapse active status to reflect IP Adapter

This commit is contained in:
blessedcoolant 2023-09-16 13:11:11 +12:00 committed by Kent Keirsey
parent 4dd289b337
commit 820ec08e9a

View File

@ -26,14 +26,23 @@ import { v4 as uuidv4 } from 'uuid';
const selector = createSelector( const selector = createSelector(
[stateSelector], [stateSelector],
({ controlNet }) => { ({ controlNet }) => {
const { controlNets, isEnabled } = controlNet; const { controlNets, isEnabled, isIPAdapterEnabled } = controlNet;
const validControlNets = getValidControlNets(controlNets); const validControlNets = getValidControlNets(controlNets);
const activeLabel = let activeLabel = undefined;
isEnabled && validControlNets.length > 0
? `${validControlNets.length} Active` if (isEnabled && validControlNets.length > 0) {
: undefined; activeLabel = `${validControlNets.length} ControlNet`;
}
if (isIPAdapterEnabled) {
if (activeLabel) {
activeLabel = `${activeLabel}, IP Adapter`;
} else {
activeLabel = 'IP Adapter';
}
}
return { controlNetsArray: map(controlNets), activeLabel }; return { controlNetsArray: map(controlNets), activeLabel };
}, },