stream post empty

This commit is contained in:
Yuri Kuznetsov
2022-08-22 10:45:52 +03:00
parent 67c0ac45bd
commit 2553496ce6
2 changed files with 4 additions and 2 deletions
+1 -1
View File
@@ -550,7 +550,7 @@ define('views/stream/panel', ['views/record/panels/relationship', 'lib!Textcompl
return;
}
if (message === '' && (this.seed.get('attachmentsIds') || []).length === 0) {
if (message.trim() === '' && (this.seed.get('attachmentsIds') || []).length === 0) {
this.notify('Post cannot be empty', 'error');
this.$textarea.prop('disabled', false);
this.controlPostButtonAvailability();
+3 -1
View File
@@ -255,7 +255,9 @@ define('views/stream/record/edit', ['views/record/base'], function (Dep) {
validate: function () {
var notValid = Dep.prototype.validate.call(this);
if (this.model.get('post') === '' && !(this.model.get('attachmentsIds') || []).length) {
let message = this.model.get('post') || '';
if (message.trim() === '' && !(this.model.get('attachmentsIds') || []).length) {
notValid = true;
}