Repository navigation
Commit 99934a3
refactor(web): preview element picker drops its unmount guard
PreviewView kept an isMountedRef, set by a mount/unmount effect, only so
three call sites could skip setPickActive(false) after unmount. Since
React 18 a setState on an unmounted component is a silent no-op, so the
guard prevented nothing. On unmount the guard's cleanup already ran
before the runtimeTabId cleanup, and on a tab change the component is
mounted, so the setState ran either way.
Remove the ref, its effect, and the three guards. pickActiveRef still
decides whether a pick is current. The runtimeTabId cleanup effect stays:
it cancels the bridge pick, which lives outside React.
Effects in PreviewView.tsx: 4 -> 3.
Co-Authored-By: Claude Opus 5.5 <[email protected]>1 parent 79f6cd3 commit 99934a3
1 file changed
Lines changed: 3 additions & 11 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
152 | 152 | | |
153 | 153 | | |
154 | 154 | | |
155 | | - | |
156 | 155 | | |
157 | 156 | | |
158 | 157 | | |
| |||
173 | 172 | | |
174 | 173 | | |
175 | 174 | | |
176 | | - | |
177 | | - | |
178 | | - | |
179 | | - | |
180 | | - | |
181 | | - | |
182 | | - | |
183 | 175 | | |
184 | 176 | | |
185 | 177 | | |
| |||
726 | 718 | | |
727 | 719 | | |
728 | 720 | | |
729 | | - | |
| 721 | + | |
730 | 722 | | |
731 | 723 | | |
732 | 724 | | |
| |||
752 | 744 | | |
753 | 745 | | |
754 | 746 | | |
755 | | - | |
| 747 | + | |
756 | 748 | | |
757 | 749 | | |
758 | 750 | | |
| |||
811 | 803 | | |
812 | 804 | | |
813 | 805 | | |
814 | | - | |
| 806 | + | |
815 | 807 | | |
816 | 808 | | |
817 | 809 | | |
| |||
0 commit comments