Skip to content

Commit 883f542

Browse files
committed
fix(web): publish held approvals before the timeline paints
1 parent 70a6512 commit 883f542

1 file changed

Lines changed: 2 additions & 1 deletion

File tree

‎apps/web/src/components/chat/ChatComposer.tsx‎

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -627,8 +627,9 @@ export const ChatComposer = memo(function ChatComposer(props: ChatComposerProps)
627627
...pendingApprovals.map((request) => request.requestId),
628628
...incomingPendingUserInputs.map((request) => request.requestId),
629629
]);
630+
// A layout effect so the timeline never paints a held approval as answerable.
630631
// oxlint-disable-next-line t3code/no-unreasoned-state-sync -- publishes held requests to the timeline without lifting per-keystroke typing state
631-
useEffect(() => {
632+
useLayoutEffect(() => {
632633
onHeldRequestIdsChange(heldRequestIds);
633634
}, [heldRequestIds, onHeldRequestIdsChange]);
634635
const activePendingApproval =

0 commit comments

Comments
 (0)