Story Ribbon: Fix hiding on scroll down (#6419)

This commit is contained in:
zubiden 2025-11-06 11:36:39 +01:00 committed by Alexander Zinchuk
parent b497a3c0ea
commit ef5b34229d
4 changed files with 12 additions and 3 deletions

View File

@ -134,6 +134,7 @@ const ArchivedChats: FC<OwnProps> = ({
isMainList
foldersDispatch={foldersDispatch}
archiveSettings={archiveSettings}
isStoryRibbonShown={isStoryRibbonShown}
/>
</div>
{shouldRenderForumPanel && (

View File

@ -368,6 +368,7 @@ const ChatFolders: FC<OwnProps & StateProps> = ({
archiveSettings={archiveSettings}
sessions={sessions}
isAccountFrozen={isAccountFrozen}
isStoryRibbonShown={isStoryRibbonShown}
withTags
/>
);

View File

@ -50,8 +50,9 @@ type OwnProps = {
sessions?: Record<string, ApiSession>;
isAccountFrozen?: boolean;
isMainList?: boolean;
foldersDispatch?: FolderEditDispatch;
withTags?: boolean;
isStoryRibbonShown?: boolean;
foldersDispatch?: FolderEditDispatch;
};
const INTERSECTION_THROTTLE = 200;
@ -68,8 +69,9 @@ const ChatList: FC<OwnProps> = ({
sessions,
isAccountFrozen,
isMainList,
foldersDispatch,
withTags,
isStoryRibbonShown,
foldersDispatch,
}) => {
const {
openChat,
@ -203,6 +205,7 @@ const ChatList: FC<OwnProps> = ({
onOverscroll: handleShowStoryRibbon,
onReset: handleHideStoryRibbon,
isDisabled: isSaved,
isOverscrolled: isStoryRibbonShown,
});
function renderChats() {

View File

@ -206,8 +206,12 @@ export default function useTopOverscroll({
}, [containerRef, isDisabled, getState]);
useEffect(() => {
if (!isOverscrolled && getState() === 'animating') {
return; // We're animating towards this state
}
setState(isOverscrolled ? 'overscroll' : 'normal');
}, [isOverscrolled, setState]);
}, [isOverscrolled, getState, setState]);
useEffect(() => {
const container = containerRef.current;