fix(ui): fix control adapter autoprocess

This commit is contained in:
psychedelicious 2023-10-06 18:11:32 +11:00
parent 6b8ce34eb3
commit 913fc83cbf

View File

@ -37,14 +37,20 @@ const predicate: AnyListenerPredicate<RootState> = (
}
const { id } = action.payload;
const ca = selectControlAdapterById(prevState.controlAdapters, id);
if (!ca || !isControlNetOrT2IAdapter(ca)) {
const prevCA = selectControlAdapterById(prevState.controlAdapters, id);
const ca = selectControlAdapterById(state.controlAdapters, id);
if (
!prevCA ||
!isControlNetOrT2IAdapter(prevCA) ||
!ca ||
!isControlNetOrT2IAdapter(ca)
) {
return false;
}
if (controlAdapterAutoConfigToggled.match(action)) {
// do not process if the user just disabled auto-config
if (ca.shouldAutoConfig === true) {
if (prevCA.shouldAutoConfig === true) {
return false;
}
}