fix: stabilize onToggleRuntimeMode with useCallback to preserve memo
Co-authored-by: Julius Marminge <[email protected]> Applied via @cursor push command
This commit is contained in:
1 parent
e354e8697f
commit
7a3d4d1f31
1 file changed
+6
-5
@@ -1675,6 +1675,11 @@ export default function ChatView({ threadId }: ChatViewProps) {
|
||||
const toggleInteractionMode = useCallback(() => {
|
||||
handleInteractionModeChange(interactionMode === "plan" ? "default" : "plan");
|
||||
}, [handleInteractionModeChange, interactionMode]);
|
||||
const toggleRuntimeMode = useCallback(() => {
|
||||
void handleRuntimeModeChange(
|
||||
runtimeMode === "full-access" ? "approval-required" : "full-access",
|
||||
);
|
||||
}, [handleRuntimeModeChange, runtimeMode]);
|
||||
const togglePlanSidebar = useCallback(() => {
|
||||
setPlanSidebarOpen((open) => {
|
||||
if (open) {
|
||||
@@ -3745,11 +3750,7 @@ export default function ChatView({ threadId }: ChatViewProps) {
|
||||
onCodexFastModeChange={onCodexFastModeChange}
|
||||
onToggleInteractionMode={toggleInteractionMode}
|
||||
onTogglePlanSidebar={togglePlanSidebar}
|
||||
onToggleRuntimeMode={() =>
|
||||
void handleRuntimeModeChange(
|
||||
runtimeMode === "full-access" ? "approval-required" : "full-access",
|
||||
)
|
||||
}
|
||||
onToggleRuntimeMode={toggleRuntimeMode}
|
||||
/>
|
||||
) : (
|
||||
<>
|
||||
|
||||
Reference in new issue
Block a user