Don't create a group without a name
This commit is contained in:
parent
d5c85dfbd8
commit
2de682ef7b
1 changed files with 6 additions and 1 deletions
|
@ -196,10 +196,15 @@ var Whisper = Whisper || {};
|
||||||
},
|
},
|
||||||
|
|
||||||
createGroup: function() {
|
createGroup: function() {
|
||||||
|
var name = this.$el.find('.new-group-update-form .name').val();
|
||||||
|
if (!name.trim().length) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
return this.avatarInput.getFiles().then(function(avatarFiles) {
|
return this.avatarInput.getFiles().then(function(avatarFiles) {
|
||||||
var attributes = {
|
var attributes = {
|
||||||
type: 'group',
|
type: 'group',
|
||||||
name: this.$el.find('.new-group-update-form .name').val(),
|
name: name,
|
||||||
avatar: avatarFiles[0],
|
avatar: avatarFiles[0],
|
||||||
members: this.recipients.pluck('id')
|
members: this.recipients.pluck('id')
|
||||||
};
|
};
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue