InvokeAI/invokeai/frontend/web/src
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
..
app fix(ui): set aspect ratio to free when using default model settings 2024-03-21 16:30:52 +11:00
common feat(ui): single getModelConfigs query 2024-03-14 23:37:40 +11:00
features fix(ui): migrate redux state that has models 2024-03-22 07:55:13 +11:00
services chore(ui): typegen 2024-03-21 07:02:57 -07:00
i18.d.ts fix(ui): improve IDE TS performance by not resolving JSON 2023-06-28 23:55:44 -04:00
i18n.ts feat(ui): handle proxy configs rewriting paths 2024-01-25 13:29:56 +11:00
index.ts tidy(ui): remove commented line 2024-01-22 09:37:26 +11:00
main.tsx chore(ui): format 2024-01-28 19:57:53 +11:00
vite-env.d.ts all files migrated; tweaks needed 2023-03-03 00:02:15 -05:00