Commit d205afe3 authored by JC Brand's avatar JC Brand

Don't try to render register link if auto_login is true

parent ebcf7098
......@@ -62,16 +62,21 @@
LoginPanel: {
render: function (cfg) {
insertRegisterLink () {
const { _converse } = this.__super__;
this.__super__.render.apply(this, arguments);
if (_converse.allow_registration) {
if (_.isUndefined(this.registerlinkview)) {
this.registerlinkview = new _converse.RegisterLinkView({'model': this.model});
this.registerlinkview.render();
this.el.querySelector('.buttons').insertAdjacentElement('beforeend', this.registerlinkview.el);
}
if (_.isUndefined(this.registerlinkview)) {
this.registerlinkview = new _converse.RegisterLinkView({'model': this.model});
this.registerlinkview.render();
this.el.querySelector('.buttons').insertAdjacentElement('beforeend', this.registerlinkview.el);
}
this.registerlinkview.render();
},
render (cfg) {
const { _converse } = this.__super__;
this.__super__.render.apply(this, arguments);
if (_converse.allow_registration && !_converse.auto_login) {
this.insertRegisterLink();
}
return this;
}
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment