If for some reason a group has no name, provide a default
This commit is contained in:
parent
0036e4ef74
commit
0bd5f3e3c2
1 changed files with 2 additions and 1 deletions
|
@ -7,6 +7,7 @@ var Whisper = Whisper || {};
|
||||||
var Thread = Backbone.Model.extend({
|
var Thread = Backbone.Model.extend({
|
||||||
defaults: function() {
|
defaults: function() {
|
||||||
return {
|
return {
|
||||||
|
name: 'New Group',
|
||||||
image: '/images/default.png',
|
image: '/images/default.png',
|
||||||
unreadCount: 0,
|
unreadCount: 0,
|
||||||
timestamp: new Date().getTime(),
|
timestamp: new Date().getTime(),
|
||||||
|
@ -97,7 +98,7 @@ var Whisper = Whisper || {};
|
||||||
if (decrypted.message.group) {
|
if (decrypted.message.group) {
|
||||||
attributes = {
|
attributes = {
|
||||||
groupId : decrypted.message.group.id,
|
groupId : decrypted.message.group.id,
|
||||||
name : decrypted.message.group.name,
|
name : decrypted.message.group.name || 'New group',
|
||||||
type : 'group',
|
type : 'group',
|
||||||
};
|
};
|
||||||
} else {
|
} else {
|
||||||
|
|
Loading…
Reference in a new issue