fix stream attachments
This commit is contained in:
@@ -105,7 +105,7 @@ Espo.define('views/stream/panel', ['views/record/panels/relationship', 'lib!Text
|
||||
if ($.contains(this.$postContainer.get(0), e.target)) return;
|
||||
if (this.$textarea.val() !== '') return;
|
||||
|
||||
var attachmentsIds = this.seed.get('attachmentsIds');
|
||||
var attachmentsIds = this.seed.get('attachmentsIds') || [];
|
||||
if (!attachmentsIds.length && !this.getView('attachments').isUploading) {
|
||||
this.disablePostingMode();
|
||||
}
|
||||
@@ -363,7 +363,7 @@ Espo.define('views/stream/panel', ['views/record/panels/relationship', 'lib!Text
|
||||
return;
|
||||
}
|
||||
|
||||
if (message == '' && this.seed.get('attachmentsIds').length == 0) {
|
||||
if (message == '' && (this.seed.get('attachmentsIds') || []).length == 0) {
|
||||
this.notify('Post cannot be empty', 'error');
|
||||
this.$textarea.prop('disabled', false);
|
||||
return;
|
||||
@@ -386,7 +386,7 @@ Espo.define('views/stream/panel', ['views/record/panels/relationship', 'lib!Text
|
||||
}, this);
|
||||
|
||||
model.set('post', message);
|
||||
model.set('attachmentsIds', Espo.Utils.clone(this.seed.get('attachmentsIds')));
|
||||
model.set('attachmentsIds', Espo.Utils.clone(this.seed.get('attachmentsIds') || []));
|
||||
model.set('type', 'Post');
|
||||
model.set('isInternal', this.isInternalNoteMode);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user