Don't create a group without a name

This commit is contained in:
lilia 2015-02-08 23:39:12 -10:00
parent d5c85dfbd8
commit 2de682ef7b

View file

@ -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')
}; };