Commit 7c9475e9 authored by JC Brand's avatar JC Brand

controlbox: Only render the contacts panel when connected

Otherwise it gets rendered multiple times (at least during testing).
parent 8fe7fd2e
......@@ -242,14 +242,17 @@
} else {
this.hide();
}
this.$el.html(tpl_controlbox(
this.el.innerHTML = tpl_controlbox(
_.extend(this.model.toJSON(), {
sticky_controlbox: _converse.sticky_controlbox
}))
);
if (!_converse.connection.connected || !_converse.connection.authenticated || _converse.connection.disconnecting) {
'sticky_controlbox': _converse.sticky_controlbox
}));
if (!_converse.connection.connected ||
!_converse.connection.authenticated ||
_converse.connection.disconnecting) {
this.renderLoginPanel();
} else if (!this.contactspanel || !this.contactspanel.$el.is(':visible')) {
} else if (this.model.get('connected') &&
(!this.contactspanel || !this.contactspanel.$el.is(':visible'))) {
this.renderContactsPanel();
}
return this;
......
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