We do need a validate method, but it needed a fix.
This commit is contained in:
parent
060fd94547
commit
9b61b2bdab
10
dist/converse.js
vendored
10
dist/converse.js
vendored
@ -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) {
|
||||
return 'Controlbox not relevant in embedded view mode';
|
||||
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()});
|
||||
|
Loading…
Reference in New Issue
Block a user