Message List: Do not mark a message as read in the background (#3383)
This commit is contained in:
parent
4e43602146
commit
4244c014cb
@ -79,6 +79,7 @@ import useMedia from '../../hooks/useMedia';
|
||||
import useLayoutEffectWithPrevDeps from '../../hooks/useLayoutEffectWithPrevDeps';
|
||||
import useEffectWithPrevDeps from '../../hooks/useEffectWithPrevDeps';
|
||||
import useContainerHeight from './hooks/useContainerHeight';
|
||||
import { isBackgroundModeActive } from '../../hooks/useBackgroundMode';
|
||||
|
||||
import Loading from '../ui/Loading';
|
||||
import MessageListContent from './MessageListContent';
|
||||
@ -463,7 +464,7 @@ const MessageList: FC<OwnProps & StateProps> = ({
|
||||
const isAlreadyFocusing = messageIds && memoFocusingIdRef.current === messageIds[messageIds.length - 1];
|
||||
|
||||
// Animate incoming message
|
||||
if (wasMessageAdded && isAtBottom && !isAlreadyFocusing) {
|
||||
if (wasMessageAdded && isAtBottom && !isAlreadyFocusing && !isBackgroundModeActive()) {
|
||||
// Break out of `forceLayout`
|
||||
requestMeasure(() => {
|
||||
animateScroll(
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user