kind of works but buggy

This commit is contained in:
or-else
2017-11-25 14:24:18 -08:00
parent afd1bbb58a
commit b2b1ca2934
+1 -1
View File
@@ -2739,7 +2739,7 @@
this.setState(function(prevState, props) { this.setState(function(prevState, props) {
if (!prevState.fetchingMessages) { if (!prevState.fetchingMessages) {
var topic = Tinode.getTopic(instance.state.topic); var topic = Tinode.getTopic(instance.state.topic);
if (topic && topic.msgHasMore()) { if (topic && topic.isSubscribed() && topic.msgHasMore()) {
newState.fetchingMessages = true; newState.fetchingMessages = true;
topic.getMessagesPage(MESSAGES_PAGE).then(function() { topic.getMessagesPage(MESSAGES_PAGE).then(function() {
instance.setState({fetchingMessages: false}); instance.setState({fetchingMessages: false});