Skip to content

Commit 653b820

Browse files
psychedelicioushipsterusername
authored andcommitted
tidy(ui): clearer variable names in modelSelected listener
1 parent 4ba0bf4 commit 653b820

File tree

1 file changed

+5
-5
lines changed
  • invokeai/frontend/web/src/app/store/middleware/listenerMiddleware/listeners

1 file changed

+5
-5
lines changed

invokeai/frontend/web/src/app/store/middleware/listenerMiddleware/listeners/modelSelected.ts

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -36,32 +36,32 @@ export const addModelSelectedListener = () => {
3636

3737
const newModel = result.data;
3838

39-
const { base_model } = newModel;
39+
const newBaseModel = newModel.base_model;
4040
const didBaseModelChange =
41-
state.generation.model?.base_model !== base_model;
41+
state.generation.model?.base_model !== newBaseModel;
4242

4343
if (didBaseModelChange) {
4444
// we may need to reset some incompatible submodels
4545
let modelsCleared = 0;
4646

4747
// handle incompatible loras
4848
forEach(state.lora.loras, (lora, id) => {
49-
if (lora.base_model !== base_model) {
49+
if (lora.base_model !== newBaseModel) {
5050
dispatch(loraRemoved(id));
5151
modelsCleared += 1;
5252
}
5353
});
5454

5555
// handle incompatible vae
5656
const { vae } = state.generation;
57-
if (vae && vae.base_model !== base_model) {
57+
if (vae && vae.base_model !== newBaseModel) {
5858
dispatch(vaeSelected(null));
5959
modelsCleared += 1;
6060
}
6161

6262
// handle incompatible controlnets
6363
selectControlAdapterAll(state.controlAdapters).forEach((ca) => {
64-
if (ca.model?.base_model !== base_model) {
64+
if (ca.model?.base_model !== newBaseModel) {
6565
dispatch(
6666
controlAdapterIsEnabledChanged({ id: ca.id, isEnabled: false })
6767
);

0 commit comments

Comments
 (0)