|
@@ -57,18 +57,18 @@ const MsgBlock = ({ chatId, getMsgs, setLastVizited, msgsCount=20 }) => {
|
|
|
|
|
|
const [msgsBlock, setMsgsBlock] = useState(0)
|
|
|
|
|
|
-
|
|
|
+
|
|
|
const divRef = useRef(null)
|
|
|
|
|
|
|
|
|
- useEffect(() => {
|
|
|
+ useEffect( () => {
|
|
|
+ console.log(chatId)
|
|
|
getMsgs(chatId, msgsBlock, msgsCount)
|
|
|
},[msgsBlock])
|
|
|
|
|
|
|
|
|
useEffect(() => {
|
|
|
// console.log(chatId, "МАУНТ СООБЩЕНИЙ")
|
|
|
-
|
|
|
const date = (new Date()).getTime()
|
|
|
setLastVizited({
|
|
|
_id: chatId,
|
|
@@ -78,7 +78,6 @@ const MsgBlock = ({ chatId, getMsgs, setLastVizited, msgsCount=20 }) => {
|
|
|
|
|
|
return () => {
|
|
|
// console.log(chatId, "АНМАУНТ СООБЩЕНИЙ")
|
|
|
-
|
|
|
const date = (new Date()).getTime()
|
|
|
setLastVizited({
|
|
|
_id: chatId,
|
|
@@ -143,5 +142,5 @@ const MsgPage = ({ match:{params:{_id}}, chats }) => {
|
|
|
}
|
|
|
|
|
|
}
|
|
|
-export const CMsgPage = connect( state => ({ chats: state.chats || {} }) )(MsgPage)
|
|
|
+export const CMsgPage = connect( state => ({ chats: state.chats }) )(MsgPage)
|
|
|
|