MUC: provide feedback when no rooms found
This commit is contained in:
parent
be2def5fad
commit
5efb7b2a84
@ -468,15 +468,16 @@ converse.plugins.add('converse-muc-views', {
|
|||||||
* @param { HTMLElement } iq
|
* @param { HTMLElement } iq
|
||||||
*/
|
*/
|
||||||
onRoomsFound (iq) {
|
onRoomsFound (iq) {
|
||||||
|
this.loading_items = false;
|
||||||
const rooms = iq ? sizzle('query item', iq) : [];
|
const rooms = iq ? sizzle('query item', iq) : [];
|
||||||
if (rooms.length) {
|
if (rooms.length) {
|
||||||
this.model.set({'feedback_text': __('Groupchats found')}, {'silent': true});
|
this.model.set({'feedback_text': __('Groupchats found')}, {'silent': true});
|
||||||
this.items = rooms.map(st.getAttributes);
|
this.items = rooms.map(st.getAttributes);
|
||||||
this.loading_items = false;
|
|
||||||
this.render();
|
|
||||||
} else {
|
} else {
|
||||||
this.model.set('feedback_text', __('No groupchats found'));
|
this.items = [];
|
||||||
|
this.model.set({'feedback_text': __('No groupchats found')}, {'silent': true});
|
||||||
}
|
}
|
||||||
|
this.render();
|
||||||
return true;
|
return true;
|
||||||
},
|
},
|
||||||
|
|
||||||
|
@ -59,7 +59,7 @@ export default (o) => html`
|
|||||||
${o.show_form ? form(o) : '' }
|
${o.show_form ? form(o) : '' }
|
||||||
<ul class="available-chatrooms list-group">
|
<ul class="available-chatrooms list-group">
|
||||||
${ o.loading_items ? html`<li class="list-group-item"> ${spinner()} </li>` : '' }
|
${ o.loading_items ? html`<li class="list-group-item"> ${spinner()} </li>` : '' }
|
||||||
${ o.items.length ? html`<li class="list-group-item active">${ o.feedback_text }:</li>` : '' }
|
${ o.feedback_text ? html`<li class="list-group-item active">${ o.feedback_text }</li>` : '' }
|
||||||
${repeat(o.items, item => item.jid, item => tpl_item(o, item))}
|
${repeat(o.items, item => item.jid, item => tpl_item(o, item))}
|
||||||
</ul>
|
</ul>
|
||||||
</div>
|
</div>
|
||||||
|
Loading…
Reference in New Issue
Block a user