InvokeAI/invokeai/frontend/web
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
..
.storybook fix(ui): update all components and logic to use enriched ModelIdentifierField 2024-03-10 11:03:38 +11:00
patches
public fix(ui): typo 2024-03-20 16:26:14 +11:00
scripts feat(ui): add script to clean translations 2024-03-14 11:38:29 +11:00
src fix(ui): migrate redux state that has models 2024-03-22 07:55:13 +11:00
static/docs
__init__.py
.eslintignore
.eslintrc.js build(ui): restore i18n eslint rule 2024-03-01 10:42:33 +11:00
.gitignore tests(ui): enable vitest type testing 2024-03-01 10:42:33 +11:00
.prettierignore
.prettierrc.js
index.html
knip.ts chore(ui): typegen, update knip config 2024-03-01 10:42:33 +11:00
package.json pkg(ui): do not fix knip in lint:fix script 2024-03-05 23:50:19 +11:00
pnpm-lock.yaml chore(ui): bump deps 2024-03-01 10:42:33 +11:00
README.md docs: move frontend docs to mkdocs 2024-03-13 22:43:20 +11:00
tsconfig.json chore(ui): lint 2024-03-01 10:42:33 +11:00
tsconfig.node.json fix(ui): fix package build 2024-03-01 10:42:33 +11:00
vite.config.mts build(ui): do not fail build on eslint error in dev mode 2024-03-01 10:42:33 +11:00