|
@@ -47,18 +47,23 @@ class ControlBoxView extends ElementView {
|
|
|
}
|
|
|
|
|
|
render () {
|
|
|
- if (this.model.get('connected') && this.model.get('closed') === undefined) {
|
|
|
- this.model.set('closed', !api.settings.get('show_controlbox_by_default'));
|
|
|
- }
|
|
|
-
|
|
|
render(tpl_controlbox({
|
|
|
'sticky_controlbox': api.settings.get('sticky_controlbox'),
|
|
|
...this.model.toJSON()
|
|
|
}), this);
|
|
|
|
|
|
+ }
|
|
|
+
|
|
|
+ afterRender () {
|
|
|
+ if (this.model.get('connected') && this.model.get('closed') === undefined) {
|
|
|
+ this.model.set('closed', !api.settings.get('show_controlbox_by_default'));
|
|
|
+ }
|
|
|
+
|
|
|
const connection = _converse?.connection;
|
|
|
if (!connection?.connected || !connection?.authenticated || connection?.disconnecting) {
|
|
|
this.classList.add('logged-out');
|
|
|
+ } else {
|
|
|
+ this.classList.remove('logged-out');
|
|
|
}
|
|
|
}
|
|
|
|