Story Ribbon: Fix hiding on scroll down (#6419)
This commit is contained in:
parent
b497a3c0ea
commit
ef5b34229d
@ -134,6 +134,7 @@ const ArchivedChats: FC<OwnProps> = ({
|
||||
isMainList
|
||||
foldersDispatch={foldersDispatch}
|
||||
archiveSettings={archiveSettings}
|
||||
isStoryRibbonShown={isStoryRibbonShown}
|
||||
/>
|
||||
</div>
|
||||
{shouldRenderForumPanel && (
|
||||
|
||||
@ -368,6 +368,7 @@ const ChatFolders: FC<OwnProps & StateProps> = ({
|
||||
archiveSettings={archiveSettings}
|
||||
sessions={sessions}
|
||||
isAccountFrozen={isAccountFrozen}
|
||||
isStoryRibbonShown={isStoryRibbonShown}
|
||||
withTags
|
||||
/>
|
||||
);
|
||||
|
||||
@ -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() {
|
||||
|
||||
@ -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;
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user