InvokeAI/invokeai/frontend/web/src/features/parameters
psychedelicious 6e869e6038 fix(ui): migrate redux state that has models
With the change to model identifiers from v3 to v4, if a user had persisted redux state with the old format, we could get unexpected runtime errors when rehydrating state if we try to access model attributes that no longer exist.

For example, the CLIP Skip component does this:

```ts
CLIP_SKIP_MAP[model.base].maxClip
```

In v3, models had a `base_type` attribute, but it is renamed to `base` in v4. This code therefore causes a runtime error:
- `model.base` is `undefined`
- `CLIP_SKIP_MAP[undefined]` is also undefined
- `undefined.maxClip` is a runtime error!

Resolved by adding a migration for the redux slices that have model identifiers. The migration simply resets the slice or the part of the slice that is affected, when it's simple to do a partial reset.

Closes #6000
2024-03-22 07:55:13 +11:00
..
components fix(ui): use the old combobox component for dropdowns 2024-03-22 07:33:52 +11:00
hooks tidy(ui): clean up unused code 3 2024-03-01 10:42:33 +11:00
store fix(ui): migrate redux state that has models 2024-03-22 07:55:13 +11:00
types fix(ui): update all components and logic to use enriched ModelIdentifierField 2024-03-10 11:03:38 +11:00
util fix(ui): update all components and logic to use enriched ModelIdentifierField 2024-03-10 11:03:38 +11:00