Skip to content

Commit a251926

Browse files
committed
Restore Latest messages pill after collapsing composer
1 parent 04654bb commit a251926

1 file changed

Lines changed: 12 additions & 0 deletions

File tree

‎src/hooks/useReportActionsScroll.ts‎

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -241,6 +241,18 @@ function useReportActionsScroll({
241241
shouldBeAlignedToTop,
242242
});
243243

244+
const prevIsComposerFullSize = usePrevious(isComposerFullSize);
245+
// Scroll events skipped pill tracking while expanded, so sync the Latest messages pill with the current offset
246+
const syncPillAfterComposerCollapse = useEffectEvent(() => {
247+
if (!prevIsComposerFullSize || isComposerFullSize || shouldDisablePillTracking) {
248+
return;
249+
}
250+
updatePillVisibility();
251+
});
252+
useEffect(() => {
253+
syncPillAfterComposerCollapse();
254+
}, [isComposerFullSize]);
255+
244256
const {isScrollToBottomEnabled, setIsScrollToBottomEnabled, completeLiveTailPruneAfterScrollToBottom} = useReportActionsNewActionLiveTail({
245257
conciergeChat,
246258
reportID,

0 commit comments

Comments
 (0)