Commit bc6b5ca9 authored by JC Brand's avatar JC Brand

controlbox: Set `connected` immediately

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