active topic is not longer disabled on startup
This commit is contained in:
+14
-4
@@ -1919,6 +1919,7 @@
|
|||||||
},
|
},
|
||||||
|
|
||||||
prepareContactList: function() {
|
prepareContactList: function() {
|
||||||
|
var instance = this;
|
||||||
var contacts = [];
|
var contacts = [];
|
||||||
var totalUnread = 0;
|
var totalUnread = 0;
|
||||||
Tinode.getMeTopic().contacts(function(c) {
|
Tinode.getMeTopic().contacts(function(c) {
|
||||||
@@ -1928,6 +1929,10 @@
|
|||||||
c.unread = c.seq - c.read;
|
c.unread = c.seq - c.read;
|
||||||
totalUnread += c.unread;
|
totalUnread += c.unread;
|
||||||
contacts.push(c);
|
contacts.push(c);
|
||||||
|
if (instance.props.topicSelected == c.topic) {
|
||||||
|
instance.props.onOnlineChange(c.online);
|
||||||
|
instance.props.onAcsChange(c.acs);
|
||||||
|
}
|
||||||
}, this);
|
}, this);
|
||||||
contacts.sort(function(a,b){
|
contacts.sort(function(a,b){
|
||||||
return b.touched - a.touched;
|
return b.touched - a.touched;
|
||||||
@@ -3643,7 +3648,7 @@
|
|||||||
this.setState(newState);
|
this.setState(newState);
|
||||||
},
|
},
|
||||||
render: function() {
|
render: function() {
|
||||||
var prompt = this.props.disabled ? "Publishing disabled" : "New message";
|
var prompt = this.props.disabled ? "Messaging disabled" : "New message";
|
||||||
var instance = this;
|
var instance = this;
|
||||||
return (
|
return (
|
||||||
<div id="send-message-panel">
|
<div id="send-message-panel">
|
||||||
@@ -3810,6 +3815,11 @@
|
|||||||
// Socket error
|
// Socket error
|
||||||
instance.handleError(err.message, "err");
|
instance.handleError(err.message, "err");
|
||||||
});
|
});
|
||||||
|
var parsed = parseUrlHash(window.location.hash);
|
||||||
|
delete parsed.params.info;
|
||||||
|
delete parsed.params.tab;
|
||||||
|
parsed.path[0] = '';
|
||||||
|
window.location.hash = composeUrlHash(parsed.path, parsed.params);
|
||||||
} else {
|
} else {
|
||||||
window.location.hash = "";
|
window.location.hash = "";
|
||||||
}
|
}
|
||||||
@@ -3967,8 +3977,9 @@
|
|||||||
withTags().
|
withTags().
|
||||||
build()
|
build()
|
||||||
).catch(function(err){
|
).catch(function(err){
|
||||||
instance.handleError(err.message, "err");
|
localStorage.removeItem("auth-token");
|
||||||
});
|
instance.handleError(err.message, "err");
|
||||||
|
});
|
||||||
window.location.hash = setUrlSidePanel(window.location.hash, 'contacts');
|
window.location.hash = setUrlSidePanel(window.location.hash, 'contacts');
|
||||||
},
|
},
|
||||||
|
|
||||||
@@ -4190,7 +4201,6 @@
|
|||||||
}
|
}
|
||||||
|
|
||||||
topic.subscribe(query.build(), setParams).then(function() {
|
topic.subscribe(query.build(), setParams).then(function() {
|
||||||
console.log("subscribe successful", Tinode.isTopicOnline(topic.name));
|
|
||||||
window.location.hash = setUrlSidePanel(window.location.hash, 'contacts');
|
window.location.hash = setUrlSidePanel(window.location.hash, 'contacts');
|
||||||
instance.handleTopicSelected(topic.name, undefined, Tinode.isTopicOnline(topic.name), topic.getAccessMode());
|
instance.handleTopicSelected(topic.name, undefined, Tinode.isTopicOnline(topic.name), topic.getAccessMode());
|
||||||
}).catch(function(err) {
|
}).catch(function(err) {
|
||||||
|
|||||||
Reference in New Issue
Block a user