Commit bc6b5ca9 authored by JC Brand's avatar JC Brand

controlbox: Set `connected` immediately

parent 273da9e8
......@@ -102,12 +102,11 @@
},
onChatBoxesFetched (collection, resp) {
const { _converse } = this.__super__;
this.__super__.onChatBoxesFetched.apply(this, arguments);
const { _converse } = this.__super__;
if (!_.includes(_.map(collection, 'id'), 'controlbox')) {
_converse.addControlBox();
_converse.addControlBox({'connected': true});
}
this.get('controlbox').save({connected:true});
},
},
......@@ -159,7 +158,6 @@
}
},
ChatBox: {
initialize () {
if (this.get('id') === 'controlbox') {
......@@ -170,7 +168,6 @@
},
},
ChatBoxView: {
insertIntoDOM () {
const { _converse } = this.__super__;
......@@ -199,14 +196,14 @@
const LABEL_CONTACTS = __('Contacts');
_converse.addControlBox = () =>
_converse.chatboxes.add({
_converse.addControlBox = (settings) => {
_converse.chatboxes.add(_.assign({
id: 'controlbox',
box_id: 'controlbox',
type: 'controlbox',
closed: !_converse.show_controlbox_by_default
})
;
}, settings))
};
_converse.ControlBoxView = _converse.ChatBoxView.extend({
tagName: 'div',
......
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