Commit f4c1e091 authored by JC Brand's avatar JC Brand

Debounce so that it doesn't get called for each fetched contact

parent d0c13ea9
......@@ -700,13 +700,13 @@
return this;
},
updateOnlineCount: function () {
updateOnlineCount: _.debounce(function () {
var $count = this.$('#online-count');
$count.text('('+converse.roster.getNumOnlineContacts()+')');
if (!$count.is(':visible')) {
$count.show();
}
},
}, converse.animate ? 100 : 0),
hide: function (callback) {
this.$el.fadeOut('fast', callback);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment