Folders: Do not display placeholder if sidebar is active (#6550)

This commit is contained in:
zubiden 2025-12-23 12:50:24 +01:00 committed by Alexander Zinchuk
parent d1f33ab9a9
commit 482f9fc070

View File

@ -208,7 +208,7 @@ const ChatFolders: FC<OwnProps & StateProps> = ({
ref: placeholderRef, ref: placeholderRef,
shouldRender: shouldRenderPlaceholder, shouldRender: shouldRenderPlaceholder,
} = useShowTransition({ } = useShowTransition({
isOpen: !orderedFolderIds, isOpen: !orderedFolderIds && !isFoldersSidebarShown,
noMountTransition: true, noMountTransition: true,
withShouldRender: true, withShouldRender: true,
}); });
@ -235,20 +235,21 @@ const ChatFolders: FC<OwnProps & StateProps> = ({
); );
} }
const shouldRenderFolders = folderTabs && folderTabs.length > 1; const hasFolders = folderTabs && folderTabs.length > 1;
const shouldRenderFolders = hasFolders && !isFoldersSidebarShown;
return ( return (
<div <div
ref={ref} ref={ref}
className={buildClassName( className={buildClassName(
'ChatFolders', 'ChatFolders',
shouldRenderFolders && shouldHideFolderTabs && !isFoldersSidebarShown && 'ChatFolders--tabs-hidden', shouldRenderFolders && shouldHideFolderTabs && 'ChatFolders--tabs-hidden',
shouldRenderStoryRibbon && 'with-story-ribbon', shouldRenderStoryRibbon && 'with-story-ribbon',
isFoldersSidebarShown && 'ChatFolders--tabs-sidebar-shown', isFoldersSidebarShown && 'ChatFolders--tabs-sidebar-shown',
)} )}
> >
{shouldRenderStoryRibbon && <StoryRibbon isClosing={isStoryRibbonClosing} />} {shouldRenderStoryRibbon && <StoryRibbon isClosing={isStoryRibbonClosing} />}
{shouldRenderFolders && !isFoldersSidebarShown ? ( {shouldRenderFolders ? (
<TabList <TabList
contextRootElementSelector="#LeftColumn" contextRootElementSelector="#LeftColumn"
tabs={folderTabs} tabs={folderTabs}
@ -262,7 +263,7 @@ const ChatFolders: FC<OwnProps & StateProps> = ({
ref={transitionRef} ref={transitionRef}
name={resolveTransitionName('slideOptimized', animationLevel, shouldSkipHistoryAnimations, lang.isRtl)} name={resolveTransitionName('slideOptimized', animationLevel, shouldSkipHistoryAnimations, lang.isRtl)}
activeKey={activeChatFolder} activeKey={activeChatFolder}
renderCount={shouldRenderFolders ? folderTabs.length : undefined} renderCount={hasFolders ? folderTabs.length : undefined}
> >
{renderCurrentTab} {renderCurrentTab}
</Transition> </Transition>