Chat views: listen whether hidden gets set and show/hide

This commit is contained in:
JC Brand 2020-09-21 17:20:07 +02:00
parent ced43363f6
commit f79fd33302
2 changed files with 3 additions and 1 deletions

View File

@ -52,11 +52,12 @@ export const ChatBoxView = View.extend({
async initialize () {
this.initDebounced();
this.listenTo(this.model, 'change:composing_spoiler', this.renderMessageForm);
this.listenTo(this.model, 'change:hidden', m => m.get('hidden') ? this.hide() : this.show());
this.listenTo(this.model, 'change:status', this.onStatusMessageChanged);
this.listenTo(this.model, 'destroy', this.remove);
this.listenTo(this.model, 'show', this.show);
this.listenTo(this.model, 'vcard:change', this.renderHeading);
this.listenTo(this.model, 'change:composing_spoiler', this.renderMessageForm);
if (this.model.contact) {
this.listenTo(this.model.contact, 'destroy', this.renderHeading);

View File

@ -89,6 +89,7 @@ export const ChatRoomView = ChatBoxView.extend({
this.listenTo(this.model, 'change', debounce(() => this.renderHeading(), 250));
this.listenTo(this.model, 'change:composing_spoiler', this.renderMessageForm);
this.listenTo(this.model, 'change:hidden', m => m.get('hidden') ? this.hide() : this.show());
this.listenTo(this.model, 'change:hidden_occupants', this.renderToolbar);
this.listenTo(this.model, 'configurationNeeded', this.getAndRenderConfigurationForm);
this.listenTo(this.model, 'destroy', this.hide);