Stories: Hide stories when opening search (#5548)

This commit is contained in:
Alexander Zinchuk 2025-02-13 14:27:40 +01:00
parent dffbd96001
commit a90522f7f9

View File

@ -117,7 +117,7 @@ const LeftMainHeader: FC<OwnProps & StateProps> = ({
const oldLang = useOldLang(); const oldLang = useOldLang();
const lang = useLang(); const lang = useLang();
const { isMobile, isDesktop } = useAppLayout(); const { isMobile } = useAppLayout();
const [isBotMenuOpen, markBotMenuOpen, unmarkBotMenuOpen] = useFlag(); const [isBotMenuOpen, markBotMenuOpen, unmarkBotMenuOpen] = useFlag();
@ -192,7 +192,7 @@ const LeftMainHeader: FC<OwnProps & StateProps> = ({
lockScreen(); lockScreen();
}); });
const isSearchFocused = (!isDesktop && !isMessageListOpen) && ( const isSearchFocused = !isMessageListOpen && (
Boolean(globalSearchChatId) Boolean(globalSearchChatId)
|| content === LeftColumnContent.GlobalSearch || content === LeftColumnContent.GlobalSearch
|| content === LeftColumnContent.Contacts || content === LeftColumnContent.Contacts
@ -218,7 +218,8 @@ const LeftMainHeader: FC<OwnProps & StateProps> = ({
const headerRef = useRef<HTMLDivElement>(null); const headerRef = useRef<HTMLDivElement>(null);
useElectronDrag(headerRef); useElectronDrag(headerRef);
const withStoryToggler = !isSearchFocused && !selectedSearchDate && !globalSearchChatId && !areContactsVisible; const withStoryToggler = !isSearchFocused
&& !selectedSearchDate && !globalSearchChatId && !areContactsVisible;
const searchContent = useMemo(() => { const searchContent = useMemo(() => {
return ( return (