Commit 04d56ec
committed
🤖 fix: prevent model selection reset in creation mode
The useEffect that initialized the project-scoped model in creation
mode was incorrectly re-running whenever `defaultModel` changed. This
meant if a user selected a different model from the dropdown and then
any storage event triggered a defaultModel update, their selection would
be silently overwritten with the favorite/default model.
Fix: Track initialization state with a ref so the model is only set once
per entry into creation mode, not on every defaultModel change. Reset
the ref when leaving creation mode so re-entering properly initializes.
_Generated with `mux`_1 parent d7560e1 commit 04d56ec
1 file changed
+13
-4
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
182 | 182 | | |
183 | 183 | | |
184 | 184 | | |
185 | | - | |
186 | | - | |
187 | | - | |
| 185 | + | |
| 186 | + | |
| 187 | + | |
| 188 | + | |
| 189 | + | |
188 | 190 | | |
189 | 191 | | |
190 | | - | |
| 192 | + | |
| 193 | + | |
| 194 | + | |
| 195 | + | |
| 196 | + | |
| 197 | + | |
| 198 | + | |
| 199 | + | |
191 | 200 | | |
192 | 201 | | |
193 | 202 | | |
| |||
0 commit comments