Commit 2564301
authored
fix(ui): fix canvas model switching (#4221)
## What type of PR is this? (check all applicable)
- [ ] Refactor
- [ ] Feature
- [x] Bug Fix
- [ ] Optimization
- [ ] Documentation Update
- [ ] Community Node Submission
## Have you discussed this change with the InvokeAI team?
- [x] Yes
- [ ] No, because:
## Description
There was no check at all to see if the canvas had a valid model already
selected. The first model in the list was selected every time.
Now, we check if its valid. If not, we go through the logic to try and
pick the first valid model.
If there are no valid models, or there was a problem listing models, the
model selection is cleared.
## Related Tickets & Documents
<!--
For pull requests that relate or close an issue, please include them
below.
For example having the text: "closes #1234" would connect the current
pull
request to issue 1234. And when we merge the pull request, Github will
automatically close the issue.
-->
- Closes #4125
## QA Instructions, Screenshots, Recordings
<!--
Please provide steps on how to test changes, any hardware or
software specifications as well as any other pertinent information.
-->
- Go to Canvas tab
- Select a model other than the first one in the list
- Go to a different tab
- Go back to Canvas tab
- The model should be the same as you selectedFile tree
1 file changed
+34
-31
lines changed- invokeai/frontend/web/src/app/store/middleware/listenerMiddleware/listeners
1 file changed
+34
-31
lines changedLines changed: 34 additions & 31 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | 1 | | |
2 | 2 | | |
3 | | - | |
4 | 3 | | |
5 | | - | |
6 | | - | |
7 | | - | |
8 | | - | |
| 4 | + | |
9 | 5 | | |
10 | 6 | | |
11 | 7 | | |
12 | 8 | | |
13 | 9 | | |
14 | | - | |
| 10 | + | |
15 | 11 | | |
16 | 12 | | |
17 | | - | |
18 | | - | |
19 | | - | |
20 | | - | |
| 13 | + | |
21 | 14 | | |
22 | | - | |
23 | | - | |
24 | | - | |
| 15 | + | |
| 16 | + | |
25 | 17 | | |
26 | 18 | | |
27 | 19 | | |
28 | | - | |
29 | | - | |
30 | | - | |
31 | | - | |
32 | | - | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
33 | 32 | | |
34 | 33 | | |
35 | | - | |
36 | | - | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
37 | 47 | | |
38 | | - | |
39 | 48 | | |
40 | | - | |
41 | | - | |
| 49 | + | |
42 | 50 | | |
43 | | - | |
44 | | - | |
| 51 | + | |
| 52 | + | |
| 53 | + | |
45 | 54 | | |
46 | | - | |
47 | 55 | | |
48 | | - | |
49 | | - | |
50 | | - | |
51 | | - | |
52 | | - | |
53 | 56 | | |
54 | 57 | | |
55 | 58 | | |
| |||
0 commit comments