Commit d151e6d
refactor: Fix CodeRabbit major issues - state carryover and useCallback pattern
Fixed two major issues identified by CodeRabbit review:
1. Fixed state carryover bug in custom-tool-store.js
- When switching tools, deploymentUsageInfo and lastExportedAt now
properly reset to null instead of carrying over from previous tool
- Prevents incorrect export reminders showing for wrong projects
2. Fixed useCallback pattern issue in ToolIde.jsx
- Replaced isCheckingUsage state in useCallback deps with useRef
- Prevents unnecessary callback recreations and potential race conditions
- Simplified useEffect dependencies to only depend on the callback
- Removed unused isCheckingUsage state variable
These changes improve code quality and prevent potential bugs without
affecting functionality.
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude <[email protected]>1 parent afde3a8 commit d151e6d
File tree
2 files changed
+12
-8
lines changed- frontend/src
- components/custom-tools/tool-ide
- store
2 files changed
+12
-8
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | 1 | | |
2 | | - | |
| 2 | + | |
3 | 3 | | |
4 | 4 | | |
5 | 5 | | |
| |||
63 | 63 | | |
64 | 64 | | |
65 | 65 | | |
66 | | - | |
67 | 66 | | |
| 67 | + | |
68 | 68 | | |
69 | 69 | | |
70 | 70 | | |
| |||
87 | 87 | | |
88 | 88 | | |
89 | 89 | | |
90 | | - | |
| 90 | + | |
91 | 91 | | |
92 | 92 | | |
93 | 93 | | |
94 | | - | |
| 94 | + | |
95 | 95 | | |
96 | 96 | | |
97 | 97 | | |
| |||
110 | 110 | | |
111 | 111 | | |
112 | 112 | | |
113 | | - | |
| 113 | + | |
114 | 114 | | |
115 | 115 | | |
116 | 116 | | |
117 | 117 | | |
118 | | - | |
119 | 118 | | |
120 | 119 | | |
121 | 120 | | |
122 | 121 | | |
123 | 122 | | |
124 | 123 | | |
125 | 124 | | |
126 | | - | |
| 125 | + | |
127 | 126 | | |
128 | 127 | | |
129 | 128 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
53 | 53 | | |
54 | 54 | | |
55 | 55 | | |
56 | | - | |
| 56 | + | |
| 57 | + | |
| 58 | + | |
| 59 | + | |
| 60 | + | |
| 61 | + | |
57 | 62 | | |
58 | 63 | | |
59 | 64 | | |
| |||
0 commit comments