Commit 55dbe3f
fix: subscribe to draft thread data directly to prevent stale activeDraftThread
The hook selected getDraftThread (a stable function reference) from the
composer draft store, then called it at render time to compute
activeDraftThread. Because the selector never changed, the component
didn't re-render when draftThreadsByThreadId was updated, causing stale
closures in handleNewThread and ChatRouteGlobalShortcuts.
Fix by subscribing directly to store.draftThreadsByThreadId[routeThreadId]
so the component re-renders whenever the draft for the active route
thread changes.
Co-authored-by: Julius Marminge <juliusmarminge@users.noreply.github.com>1 parent a6958f5 commit 55dbe3f
1 file changed
+3
-2
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
11 | 11 | | |
12 | 12 | | |
13 | 13 | | |
14 | | - | |
15 | 14 | | |
16 | 15 | | |
17 | 16 | | |
| |||
26 | 25 | | |
27 | 26 | | |
28 | 27 | | |
29 | | - | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
30 | 31 | | |
31 | 32 | | |
32 | 33 | | |
| |||
0 commit comments