bug fix: in some cases messges never marked as read

This commit is contained in:
or-else
2018-03-26 19:46:13 -07:00
parent f68d4d3e24
commit ed268053f3
+5 -5
View File
@@ -2992,6 +2992,10 @@
scrollPosition: 0 scrollPosition: 0
}); });
tryToResubscribe = true; tryToResubscribe = true;
// The user switched to the new topic before the timer for
// the previous topic has triggered, kill it.
clearTimeout(this.readTimer);
} }
if (!topic.isSubscribed() && tryToResubscribe) { if (!topic.isSubscribed() && tryToResubscribe) {
@@ -3006,10 +3010,6 @@
instance.props.onError(err.message, "err"); instance.props.onError(err.message, "err");
}); });
} }
// The user switched to the new topic before the timer for
// the previous topic has triggered, kill it.
clearTimeout(this.readTimer);
}, },
leave: function() { leave: function() {
@@ -3610,7 +3610,7 @@
handleConnected: function() { handleConnected: function() {
var params = Tinode.getServerInfo(); var params = Tinode.getServerInfo();
this.setState({ this.setState({
serverVersion: params.ver + " (" + (params.build ? params.build : "none") + ")" serverVersion: params.ver + " " + (params.build ? params.build : "none") + "; "
}); });
this.doLogin(this.state.login, this.state.password); this.doLogin(this.state.login, this.state.password);
}, },