Move MUC sidebar component to plugin folder

and fix update issue where occupants weren't being shown in the sidebar
when reloading the page
This commit is contained in:
JC Brand 2021-02-12 14:55:00 +01:00
parent 3ae71a45a2
commit c43969fece
3 changed files with 4 additions and 3 deletions

View File

@ -4,7 +4,6 @@
* @description XEP-0045 Multi-User Chat Views * @description XEP-0045 Multi-User Chat Views
* @license Mozilla Public License (MPLv2) * @license Mozilla Public License (MPLv2)
*/ */
import '../../components/muc-sidebar';
import '../chatview/index.js'; import '../chatview/index.js';
import '../modal.js'; import '../modal.js';
import MUCView from './muc.js'; import MUCView from './muc.js';

View File

@ -1,6 +1,6 @@
import 'shared/autocomplete/index.js'; import 'shared/autocomplete/index.js';
import tpl_muc_sidebar from "templates/muc_sidebar.js"; import tpl_muc_sidebar from "templates/muc_sidebar.js";
import { CustomElement } from './element.js'; import { CustomElement } from 'components/element.js';
import { api, converse } from "@converse/headless/core"; import { api, converse } from "@converse/headless/core";
const u = converse.env.utils; const u = converse.env.utils;
@ -20,6 +20,7 @@ export default class MUCSidebar extends CustomElement {
this.listenTo(this.occupants, 'add', this.requestUpdate); this.listenTo(this.occupants, 'add', this.requestUpdate);
this.listenTo(this.occupants, 'remove', this.requestUpdate); this.listenTo(this.occupants, 'remove', this.requestUpdate);
this.listenTo(this.occupants, 'change', this.requestUpdate); this.listenTo(this.occupants, 'change', this.requestUpdate);
this.chatroom.initialized.then(() => this.requestUpdate());
} }
render () { render () {

View File

@ -1,5 +1,6 @@
import '../heading.js';
import '../bottom_panel.js'; import '../bottom_panel.js';
import '../heading.js';
import '../sidebar.js';
import { html } from "lit-html"; import { html } from "lit-html";
export default (o) => html` export default (o) => html`