Comments: Fix back button stuck on reload (#2746)

This commit is contained in:
Alexander Zinchuk 2023-03-03 16:35:22 +01:00
parent 17ff3b47a7
commit ddc058899e

View File

@ -235,7 +235,7 @@ const MiddleHeader: FC<OwnProps & StateProps> = ({
} }
if (messageListType === 'thread' && currentTransitionKey === 0) { if (messageListType === 'thread' && currentTransitionKey === 0) {
if (isMobile || shouldShowCloseButton) { if (!isTablet || shouldShowCloseButton) {
e.stopPropagation(); // Stop propagation to prevent chat re-opening on tablets e.stopPropagation(); // Stop propagation to prevent chat re-opening on tablets
openChat({ id: undefined }, { forceOnHeavyAnimation: true }); openChat({ id: undefined }, { forceOnHeavyAnimation: true });
} else { } else {
@ -250,8 +250,8 @@ const MiddleHeader: FC<OwnProps & StateProps> = ({
openPreviousChat(); openPreviousChat();
setBackButtonActive(); setBackButtonActive();
}, [ }, [
messageListType, currentTransitionKey, isSelectModeActive, openPreviousChat, shouldShowCloseButton, isMobile, isSelectModeActive, messageListType, currentTransitionKey, setBackButtonActive, isTablet,
openChat, toggleLeftColumn, exitMessageSelectMode, setBackButtonActive, isMobile, shouldShowCloseButton,
]); ]);
const canToolsCollideWithChatInfo = ( const canToolsCollideWithChatInfo = (