mirror of
https://gitlab.com/MrFry/qmining-page
synced 2025-04-01 20:23:44 +02:00
April update
This commit is contained in:
parent
4748c23769
commit
ce63911b68
18 changed files with 1046 additions and 253 deletions
|
@ -12,12 +12,6 @@ const byDate = (a, b) => {
|
|||
return a.date - b.date
|
||||
}
|
||||
|
||||
function countAllMessages(msgs) {
|
||||
return Object.keys(msgs).reduce((acc, key) => {
|
||||
return acc + msgs[key].length
|
||||
}, 0)
|
||||
}
|
||||
|
||||
function groupPrevMessages(msgs, currUser) {
|
||||
return msgs.reduce((acc, msg) => {
|
||||
const group =
|
||||
|
@ -152,7 +146,6 @@ export default class Chat extends React.Component {
|
|||
}
|
||||
|
||||
if (
|
||||
prevState.selectedUser &&
|
||||
prevState.msgs &&
|
||||
prevState.msgs[prevState.selectedUser] &&
|
||||
this.state.msgs &&
|
||||
|
@ -164,6 +157,9 @@ export default class Chat extends React.Component {
|
|||
if (prevLatest && newLatest && prevLatest.date !== newLatest.date) {
|
||||
this.scrollToChatBottom()
|
||||
}
|
||||
if (prevState.msgs[prevState.selectedUser].msgs.length === 1) {
|
||||
this.scrollToChatBottom()
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue