check if topic has unsubscribed while processing pending messages

This commit is contained in:
or-else
2018-10-06 11:49:34 +03:00
parent ca212fb038
commit c52b661c87
+1 -1
View File
@@ -3882,7 +3882,7 @@ class MessagesView extends React.Component {
this.props.onNewTopicCreated(props.topic, ctrl.topic); this.props.onNewTopicCreated(props.topic, ctrl.topic);
// If there are unsent messages, try sending them now. // If there are unsent messages, try sending them now.
topic.queuedMessages((pub) => { topic.queuedMessages((pub) => {
if (!pub._sending) { if (!pub._sending && topic.isSubscribed()) {
topic.publishMessage(pub); topic.publishMessage(pub);
} }
}); });