Commit 5566cdb
authored
🤖 fix: use functional update for project expand/collapse state (#1017)
Fixes project expand/collapse bug where clicking one project could
affect another project's state.
The `toggleProject` function had a stale closure issue - it read from
`expandedProjects` which was a new Set recreated on every render. When
clicking rapidly, subsequent clicks could use stale state from an
earlier render.
Changed to use functional update pattern with `setExpandedProjectsArray`
to always get the current state directly from React.
---
_Generated with `mux`_1 parent dc6e5b1 commit 5566cdb
1 file changed
+15
-12
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
231 | 231 | | |
232 | 232 | | |
233 | 233 | | |
234 | | - | |
235 | | - | |
236 | | - | |
237 | 234 | | |
238 | 235 | | |
239 | 236 | | |
| |||
263 | 260 | | |
264 | 261 | | |
265 | 262 | | |
266 | | - | |
267 | | - | |
268 | | - | |
269 | | - | |
270 | | - | |
271 | | - | |
272 | | - | |
273 | | - | |
274 | | - | |
| 263 | + | |
| 264 | + | |
| 265 | + | |
| 266 | + | |
| 267 | + | |
| 268 | + | |
| 269 | + | |
| 270 | + | |
| 271 | + | |
| 272 | + | |
| 273 | + | |
| 274 | + | |
| 275 | + | |
| 276 | + | |
| 277 | + | |
275 | 278 | | |
276 | 279 | | |
277 | 280 | | |
| |||
0 commit comments