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 isMainList
foldersDispatch={foldersDispatch} foldersDispatch={foldersDispatch}
archiveSettings={archiveSettings} archiveSettings={archiveSettings}
isStoryRibbonShown={isStoryRibbonShown}
/> />
</div> </div>
{shouldRenderForumPanel && ( {shouldRenderForumPanel && (

View File

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

View File

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

View File

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