diff --git a/conversejs/custom/plugins/notes/templates/muc-note-app.js b/conversejs/custom/plugins/notes/templates/muc-note-app.js index ec409bcb..ad471ca9 100644 --- a/conversejs/custom/plugins/notes/templates/muc-note-app.js +++ b/conversejs/custom/plugins/notes/templates/muc-note-app.js @@ -9,22 +9,17 @@ import { __ } from 'i18n' export function tplMUCNoteApp (el, mucModel) { if (!mucModel) { // should not happen - el.classList.add('hidden') // we must do this, otherwise will have CSS side effects return html`` } if (!mucModel.notes) { // too soon, not initialized yet (this will happen) - el.classList.add('hidden') // we must do this, otherwise will have CSS side effects return html`` } if (!el.show) { - el.classList.add('hidden') return html`` } - el.classList.remove('hidden') - // eslint-disable-next-line no-undef const i18nNotes = __(LOC_moderator_notes) // eslint-disable-next-line no-undef diff --git a/conversejs/custom/plugins/tasks/templates/muc-task-app.js b/conversejs/custom/plugins/tasks/templates/muc-task-app.js index 5dcbd8a3..33255a8d 100644 --- a/conversejs/custom/plugins/tasks/templates/muc-task-app.js +++ b/conversejs/custom/plugins/tasks/templates/muc-task-app.js @@ -9,22 +9,17 @@ import { __ } from 'i18n' export function tplMUCTaskApp (el, mucModel) { if (!mucModel) { // should not happen - el.classList.add('hidden') // we must do this, otherwise will have CSS side effects return html`` } if (!mucModel.tasklists) { // too soon, not initialized yet (this will happen) - el.classList.add('hidden') // we must do this, otherwise will have CSS side effects return html`` } if (!el.show) { - el.classList.add('hidden') return html`` } - el.classList.remove('hidden') - // eslint-disable-next-line no-undef const i18nTasks = __(LOC_tasks) // eslint-disable-next-line no-undef diff --git a/conversejs/custom/shared/components/muc-app.js b/conversejs/custom/shared/components/muc-app.js index 8ab03c5e..40f13911 100644 --- a/conversejs/custom/shared/components/muc-app.js +++ b/conversejs/custom/shared/components/muc-app.js @@ -51,6 +51,16 @@ export class MUCApp extends CustomElement { return '' } + updated () { + if (this.innerText.trim() === '') { + this.classList.add('hidden') // we must do this, otherwise will have CSS side effects + } else { + this.classList.remove('hidden') + } + + super.updated() + } + toggleApp () { this.show = !this.show if (this.sessionStorangeShowKey) {