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
1 changed files with 6 additions and 1 deletions

View File

@ -196,10 +196,15 @@ var Whisper = Whisper || {};
},
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) {
var attributes = {
type: 'group',
name: this.$el.find('.new-group-update-form .name').val(),
name: name,
avatar: avatarFiles[0],
members: this.recipients.pluck('id')
};