#2092 fixes room list update loop with locked muc domains (#2268)

* Only update the room list after shown.bs.modal
* add changes to CHANGES.md
* Move shown listener to initialize
This commit is contained in:
Koen Van den Wijngaert 2020-10-07 10:37:35 +02:00 committed by GitHub
parent f68eb65cd7
commit 15aef10d5d
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 6 additions and 11 deletions

View File

@ -34,6 +34,7 @@ Soon we'll deprecate the latter, so prepare now.
- #2201: added html to converse.env
- #2213: added CustomElement to converse.env
- #2220: fix rendering of emojis in case `use_system_emojis == false` (again).
- #2092: fixes room list update loop when having the `locked_muc_domain` truthy or `'hidden'`
- The `api.archive.query` method no longer accepts an RSM instance as argument.
- The plugin `converse-uniview` has been removed and its functionality merged into `converse-chatboxviews`
- Removed the mockups from the project. Recommended to use tests instead.

View File

@ -93,6 +93,11 @@ export default BootstrapModal.extend({
this.model.save('muc_domain', api.settings.get('muc_domain'));
}
this.listenTo(this.model, 'change:muc_domain', this.onDomainChange);
this.el.addEventListener('shown.bs.modal', () => api.settings.get('locked_muc_domain')
? this.updateRoomsList()
: this.el.querySelector('input[name="server"]').focus()
);
},
toHTML () {
@ -110,17 +115,6 @@ export default BootstrapModal.extend({
}));
},
afterRender () {
if (api.settings.get('locked_muc_domain')) {
this.updateRoomsList();
} else {
this.el.addEventListener('shown.bs.modal',
() => this.el.querySelector('input[name="server"]').focus(),
false
);
}
},
openRoom (ev) {
ev.preventDefault();
const jid = ev.target.getAttribute('data-room-jid');