Guard commitRename cleanup against concurrent renames
After the async dispatch, only clear renamingThreadId if it still matches the thread being renamed, preventing a second rename's input from being cleared by the first's completion. Co-Authored-By: Claude Opus 4.6 <[email protected]>
This commit is contained in:
1 parent
674720c6cd
commit
c530e5d50f
1 file changed
+5
-1
@@ -543,7 +543,11 @@ export default function Sidebar() {
|
||||
description: error instanceof Error ? error.message : "An error occurred.",
|
||||
});
|
||||
}
|
||||
cancelRename();
|
||||
setRenamingThreadId((current) => {
|
||||
if (current !== threadId) return current;
|
||||
renamingInputRef.current = null;
|
||||
return null;
|
||||
});
|
||||
},
|
||||
[cancelRename],
|
||||
);
|
||||
|
||||
Reference in new issue
Block a user