mirror of
https://github.com/invoke-ai/InvokeAI
synced 2024-08-30 20:32:17 +00:00
tidy(ui): clearer variable names in modelSelected listener
This commit is contained in:
parent
4ba0bf4dcf
commit
653b820da1
@ -36,9 +36,9 @@ export const addModelSelectedListener = () => {
|
|||||||
|
|
||||||
const newModel = result.data;
|
const newModel = result.data;
|
||||||
|
|
||||||
const { base_model } = newModel;
|
const newBaseModel = newModel.base_model;
|
||||||
const didBaseModelChange =
|
const didBaseModelChange =
|
||||||
state.generation.model?.base_model !== base_model;
|
state.generation.model?.base_model !== newBaseModel;
|
||||||
|
|
||||||
if (didBaseModelChange) {
|
if (didBaseModelChange) {
|
||||||
// we may need to reset some incompatible submodels
|
// we may need to reset some incompatible submodels
|
||||||
@ -46,7 +46,7 @@ export const addModelSelectedListener = () => {
|
|||||||
|
|
||||||
// handle incompatible loras
|
// handle incompatible loras
|
||||||
forEach(state.lora.loras, (lora, id) => {
|
forEach(state.lora.loras, (lora, id) => {
|
||||||
if (lora.base_model !== base_model) {
|
if (lora.base_model !== newBaseModel) {
|
||||||
dispatch(loraRemoved(id));
|
dispatch(loraRemoved(id));
|
||||||
modelsCleared += 1;
|
modelsCleared += 1;
|
||||||
}
|
}
|
||||||
@ -54,14 +54,14 @@ export const addModelSelectedListener = () => {
|
|||||||
|
|
||||||
// handle incompatible vae
|
// handle incompatible vae
|
||||||
const { vae } = state.generation;
|
const { vae } = state.generation;
|
||||||
if (vae && vae.base_model !== base_model) {
|
if (vae && vae.base_model !== newBaseModel) {
|
||||||
dispatch(vaeSelected(null));
|
dispatch(vaeSelected(null));
|
||||||
modelsCleared += 1;
|
modelsCleared += 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
// handle incompatible controlnets
|
// handle incompatible controlnets
|
||||||
selectControlAdapterAll(state.controlAdapters).forEach((ca) => {
|
selectControlAdapterAll(state.controlAdapters).forEach((ca) => {
|
||||||
if (ca.model?.base_model !== base_model) {
|
if (ca.model?.base_model !== newBaseModel) {
|
||||||
dispatch(
|
dispatch(
|
||||||
controlAdapterIsEnabledChanged({ id: ca.id, isEnabled: false })
|
controlAdapterIsEnabledChanged({ id: ca.id, isEnabled: false })
|
||||||
);
|
);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user