Skip to content

Commit

Permalink
fix conversation list sort issue.
Browse files Browse the repository at this point in the history
  • Loading branch information
imndx committed Jul 6, 2019
1 parent 6f1acf0 commit 325d313
Showing 1 changed file with 16 additions and 8 deletions.
24 changes: 16 additions & 8 deletions src/js/pages/Home/Chats/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -92,17 +92,21 @@ export default class Chats extends Component {
}

onSendMessage = (msg) => {
if (this.props.conversation.equal(msg.conversation)) {
this.props.reloadConversation(msg.conversation);
}
// if (this.props.conversation.equal(msg.conversation)) {
// this.props.reloadConversation(msg.conversation);
// }
// this.props.reloadConversation(msg.conversation);
this.props.loadConversations();
}

onReceiveMessage = (msg) => {
this.props.reloadConversation(msg.conversation);
// this.props.reloadConversation(msg.conversation);
this.props.loadConversations();
}

onConversationInfoUpdate = (conversationInfo) => {
this.props.reloadConversation(conversationInfo.conversation);
// this.props.reloadConversation(conversationInfo.conversation);
this.props.loadConversations();
}

onRecallMessage = (operatorId, messageUid) => {
Expand All @@ -118,9 +122,9 @@ export default class Chats extends Component {
}

onConnectionStatusChange = () => {
if (status === 1) {
this.props.loadConversations();
}
// if (status === 1) {
// this.props.loadConversations();
// }
}

onUserInfoUpdate = (userId) => {
Expand Down Expand Up @@ -151,6 +155,10 @@ export default class Chats extends Component {
this.props.event.on(EventType.ConnectionStatusChanged, this.onConnectionStatusChange);
this.props.event.on(EventType.UserInfoUpdate, this.onUserInfoUpdate);
this.props.event.on(EventType.GroupInfoUpdate, this.onGroupInfoUpdate);

setTimeout(() => {
this.props.loadConversations();
}, 200)
}

componentWillUnmount() {
Expand Down

0 comments on commit 325d313

Please sign in to comment.