|
@@ -11,7 +11,7 @@ import MessageRightText from './Messages/MessageRightText'
|
|
import MessageRightImage from './Messages/MessageRightImage'
|
|
import MessageRightImage from './Messages/MessageRightImage'
|
|
import MessageRightAudio from './Messages/MessageRightAudio'
|
|
import MessageRightAudio from './Messages/MessageRightAudio'
|
|
import AlertInfo from "../../../reusableComponents/AlertInfo";
|
|
import AlertInfo from "../../../reusableComponents/AlertInfo";
|
|
-import { getMessages } from '../../../../redux/messages/selector'
|
|
|
|
|
|
+import { getMessagesMemo } from '../../../../redux/messages/selector'
|
|
import { getNumber } from '../../../../redux/authorization/selector'
|
|
import { getNumber } from '../../../../redux/authorization/selector'
|
|
import { getChat } from '../../../../redux/chat/selector'
|
|
import { getChat } from '../../../../redux/chat/selector'
|
|
import { getScroll } from '../../../../redux/control/selector'
|
|
import { getScroll } from '../../../../redux/control/selector'
|
|
@@ -43,7 +43,7 @@ const useStyles = makeStyles({
|
|
const ChatBar = () => {
|
|
const ChatBar = () => {
|
|
const classes = useStyles();
|
|
const classes = useStyles();
|
|
const dispatch = useDispatch()
|
|
const dispatch = useDispatch()
|
|
- const messages = useSelector(getMessages)
|
|
|
|
|
|
+ const messages = useSelector(getMessagesMemo)
|
|
const userNumber = useSelector(getNumber)
|
|
const userNumber = useSelector(getNumber)
|
|
const { companionId } = useSelector(getChat)
|
|
const { companionId } = useSelector(getChat)
|
|
const scroll = useSelector(getScroll)
|
|
const scroll = useSelector(getScroll)
|
|
@@ -77,7 +77,6 @@ const ChatBar = () => {
|
|
return () => clearInterval(idInterval);
|
|
return () => clearInterval(idInterval);
|
|
}, [dispatch, companionId]);
|
|
}, [dispatch, companionId]);
|
|
|
|
|
|
-
|
|
|
|
return (
|
|
return (
|
|
<div ref={divRef} className={classes.container} onScroll={debouncedHandleScroll}>
|
|
<div ref={divRef} className={classes.container} onScroll={debouncedHandleScroll}>
|
|
<div className={classes.messagesBody}>
|
|
<div className={classes.messagesBody}>
|