Bugfix, don't call create if we don't yet have a connection

This commit is contained in:
JC Brand 2013-03-28 11:38:16 +02:00
parent 5255457630
commit 2b78460e82

View File

@ -1004,6 +1004,8 @@
id: 'controlbox', id: 'controlbox',
box_id: 'controlbox' box_id: 'controlbox'
}); });
} else {
this.get('controlbox').save();
} }
// This will make sure the Roster is set up // This will make sure the Roster is set up
this.get('controlbox').set({connected:true}); this.get('controlbox').set({connected:true});
@ -1874,11 +1876,14 @@
} else { } else {
var controlbox = this.chatboxes.get('controlbox'); var controlbox = this.chatboxes.get('controlbox');
if (!controlbox) { if (!controlbox) {
controlbox = this.chatboxes.create({ controlbox = this.chatboxes.add({
id: 'controlbox', id: 'controlbox',
box_id: 'controlbox', box_id: 'controlbox',
visible: true visible: true
}); });
if (this.connection) {
controlbox.save();
}
} else { } else {
controlbox.trigger('show'); controlbox.trigger('show');
} }