fix online status

This commit is contained in:
or-else
2017-12-05 22:23:18 -08:00
parent 9009667c5a
commit 1a3362f1cd
+8 -6
View File
@@ -336,7 +336,7 @@
return; return;
} }
var promise = all ? var promise = all ?
topic.delMessagesAll(hard) : topic.delMessagesAll(hard) :
topic.delMessagesList([params.seq], hard); topic.delMessagesList([params.seq], hard);
promise.catch(function(err) { promise.catch(function(err) {
if (errorHandler) { if (errorHandler) {
@@ -1405,7 +1405,7 @@
e.preventDefault(); e.preventDefault();
e.stopPropagation(); e.stopPropagation();
if (this.props.onSelected) { if (this.props.onSelected) {
this.props.onSelected(this.props.item, this.props.index); this.props.onSelected(this.props.item, this.props.index, this.props.now);
} }
}, },
@@ -3402,20 +3402,22 @@
}, },
// User clicked on a contact in the side panel or deleted a contact. // User clicked on a contact in the side panel or deleted a contact.
handleTopicSelected: function(topicName) { handleTopicSelected: function(topicName, unused_index, online) {
if (topicName) { if (topicName) {
// Contact selected // Contact selected
this.setState({ this.setState({
topicSelected: topicName, topicSelected: topicName,
mobilePanel: 'topic-view', mobilePanel: 'topic-view',
showInfoPanel: false showInfoPanel: false,
topicSelectedOnline: online
}); });
} else { } else {
// Currently selected contact deleted // Currently selected contact deleted
this.setState({ this.setState({
topicSelected: null, topicSelected: null,
mobilePanel: 'sidepanel', mobilePanel: 'sidepanel',
showInfoPanel: false showInfoPanel: false,
topicSelectedOnline: false
}); });
} }
}, },
@@ -3573,7 +3575,7 @@
} }
var instance = this; var instance = this;
topic.leave(true).then(function(ctrl) { topic.leave(true).then(function(ctrl) {
// Hide MessageView and InfoView panels. // Hide MessagesView and InfoView panels.
instance.setState({ instance.setState({
topicSelected: '', topicSelected: '',
showInfoPanel: false, showInfoPanel: false,