If for some reason a group has no name, provide a default

This commit is contained in:
lilia 2014-10-17 13:14:09 -07:00
parent 0036e4ef74
commit 0bd5f3e3c2

View file

@ -7,6 +7,7 @@ var Whisper = Whisper || {};
var Thread = Backbone.Model.extend({
defaults: function() {
return {
name: 'New Group',
image: '/images/default.png',
unreadCount: 0,
timestamp: new Date().getTime(),
@ -97,7 +98,7 @@ var Whisper = Whisper || {};
if (decrypted.message.group) {
attributes = {
groupId : decrypted.message.group.id,
name : decrypted.message.group.name,
name : decrypted.message.group.name || 'New group',
type : 'group',
};
} else {