lazy instantiation

pull/618/head
sachaaaaa 5 years ago
parent bd9a900a1b
commit 7f96b4c95c

@ -8,12 +8,18 @@
Whisper.BulkEditView = Whisper.View.extend({
initialize(options) {
this.memberView = null;
this.props = {
onCancel: options.onCancel,
onDelete: options.onDelete,
messageCount: 0,
};
},
render() {
if (this.memberView) {
this.memberView.update(this.props);
return;
}
this.memberView = new Whisper.ReactWrapperView({
className: 'bulk-edit-view',
Component: window.Signal.Components.BulkEdit,
@ -22,9 +28,6 @@
this.$el.append(this.memberView.el);
},
render() {
this.memberView.update(this.props);
},
update(selectionSize) {
this.props.messageCount = selectionSize;

Loading…
Cancel
Save