The best way to control Claude Code, Codex and more from any computer or phone
Mirrored from https://github.com/Camo67/t3code.git
Synced Nov 25, 08:45 UTC
fix: stabilize onToggleRuntimeMode with useCallback to preserve memo
Co-authored-by: Julius Marminge <juliusmarminge@users.noreply.github.com> Applied via @cursor push command
Cursor Agent committed
Mar 9, 2026 at 18:57 UTC
7a3d4d1f31e4316eb832f820012bf575aa57669a
1 file changed
+6
-5
apps/web/src/components/ChatView.tsx
+6
-5
@@ -1675,6 +1675,11 @@ export default function ChatView({ threadId }: ChatViewProps) {
1675
const toggleInteractionMode = useCallback(() => {
1676
handleInteractionModeChange(interactionMode === "plan" ? "default" : "plan");
1677
}, [handleInteractionModeChange, interactionMode]);
1678
+ const toggleRuntimeMode = useCallback(() => {
1679
+ void handleRuntimeModeChange(
1680
+ runtimeMode === "full-access" ? "approval-required" : "full-access",
1681
+ );
1682
+ }, [handleRuntimeModeChange, runtimeMode]);
1683
const togglePlanSidebar = useCallback(() => {
1684
setPlanSidebarOpen((open) => {
1685
if (open) {
@@ -3745,11 +3750,7 @@ export default function ChatView({ threadId }: ChatViewProps) {
3750
onCodexFastModeChange={onCodexFastModeChange}
3751
onToggleInteractionMode={toggleInteractionMode}
3752
onTogglePlanSidebar={togglePlanSidebar}
3748
- onToggleRuntimeMode={() =>
3749
- void handleRuntimeModeChange(
3750
- runtimeMode === "full-access" ? "approval-required" : "full-access",
3751
- )
3752
- }
3753
+ onToggleRuntimeMode={toggleRuntimeMode}
3754
/>
3755
) : (
3756
<>