Commit 9b61b2bd authored by JC Brand's avatar JC Brand

We do need a validate method, but it needed a fix.

parent 060fd945
......@@ -50971,9 +50971,15 @@ _converse_headless_converse_core__WEBPACK_IMPORTED_MODULE_5__["default"].plugins
validate(attrs, options) {
const _converse = this.__super__._converse;
if (_converse.view_mode === 'embedded' && attrs.type === _converse.CONTROLBOX_TYPE) {
if (attrs.type === _converse.CONTROLBOX_TYPE) {
if (_converse.view_mode === 'embedded') {
return 'Controlbox not relevant in embedded view mode';
}
return;
}
return this.__super__.validate.apply(this, arguments);
},
initialize() {
......@@ -145,6 +145,17 @@ converse.plugins.add('converse-controlbox', {
},
ChatBox: {
validate (attrs, options) {
const { _converse } = this.__super__;
if (attrs.type === _converse.CONTROLBOX_TYPE) {
if (_converse.view_mode === 'embedded') {
return 'Controlbox not relevant in embedded view mode';
}
return;
}
return this.__super__.validate.apply(this, arguments);
},
initialize () {
if (this.get('id') === 'controlbox') {
this.set({'time_opened': moment(0).valueOf()});
......
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