Skip to content

Commit 6f4eae0

Browse files
committed
fix(web): publish held approvals before the timeline paints
1 parent 9687eea commit 6f4eae0

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
@@ -633,8 +633,9 @@ export const ChatComposer = memo(function ChatComposer(props: ChatComposerProps)
633633
...pendingApprovals.map((request) => request.requestId),
634634
...incomingPendingUserInputs.map((request) => request.requestId),
635635
]);
636+
// A layout effect so the timeline never paints a held approval as answerable.
636637
// oxlint-disable-next-line t3code/no-unreasoned-state-sync -- publishes held requests to the timeline without lifting per-keystroke typing state
637-
useEffect(() => {
638+
useLayoutEffect(() => {
638639
onHeldRequestIdsChange(heldRequestIds);
639640
}, [heldRequestIds, onHeldRequestIdsChange]);
640641
const activePendingApproval =

0 commit comments

Comments
 (0)