Make initialized
a promise and use it in the controlbox
This commit is contained in:
parent
bc6b5ca930
commit
956340aa8c
@ -735,12 +735,12 @@
|
|||||||
_converse.chatboxviews.$el.prepend(this.render());
|
_converse.chatboxviews.$el.prepend(this.render());
|
||||||
this.updateOnlineCount();
|
this.updateOnlineCount();
|
||||||
const that = this;
|
const that = this;
|
||||||
_converse.on('initialized', function () {
|
_converse.api.waitUntil('initialized').then(() => {
|
||||||
_converse.roster.on("add", that.updateOnlineCount, that);
|
_converse.roster.on("add", that.updateOnlineCount, that);
|
||||||
_converse.roster.on('change', that.updateOnlineCount, that);
|
_converse.roster.on('change', that.updateOnlineCount, that);
|
||||||
_converse.roster.on("destroy", that.updateOnlineCount, that);
|
_converse.roster.on("destroy", that.updateOnlineCount, that);
|
||||||
_converse.roster.on("remove", that.updateOnlineCount, that);
|
_converse.roster.on("remove", that.updateOnlineCount, that);
|
||||||
});
|
}).catch(_.partial(_converse.log, _, Strophe.LogLevel.FATAL));
|
||||||
},
|
},
|
||||||
|
|
||||||
render () {
|
render () {
|
||||||
|
@ -150,6 +150,7 @@
|
|||||||
};
|
};
|
||||||
|
|
||||||
const PROMISES = [
|
const PROMISES = [
|
||||||
|
'initialized',
|
||||||
'cachedRoster',
|
'cachedRoster',
|
||||||
'pluginsInitialized',
|
'pluginsInitialized',
|
||||||
'roster',
|
'roster',
|
||||||
|
Loading…
Reference in New Issue
Block a user