From 853b578551c99515ce16acddbddde855925e4d0a Mon Sep 17 00:00:00 2001 From: lilia Date: Tue, 14 Jul 2015 16:40:09 -0700 Subject: [PATCH] Change default value for active_at We're overriding the default with null often enough that we should just change the default. Consequently, no more phantom blank conversations with oneself should appear after receiving a group update. They were being added to the inbox because they were incorrectly initialized with an active_at value. Fixes #281 --- js/background.js | 4 +--- js/models/conversations.js | 3 +-- js/views/new_conversation_view.js | 1 - js/views/recipients_input_view.js | 1 - 4 files changed, 2 insertions(+), 7 deletions(-) diff --git a/js/background.js b/js/background.js index 5647de29..ccbf8c62 100644 --- a/js/background.js +++ b/js/background.js @@ -69,8 +69,7 @@ name: contactDetails.name, id: contactDetails.number, avatar: contactDetails.avatar, - type: 'private', - active_at: null + type: 'private' }).save(); } @@ -82,7 +81,6 @@ members: groupDetails.members, avatar: groupDetails.avatar, type: 'group', - active_at: null }).save(); } diff --git a/js/models/conversations.js b/js/models/conversations.js index 0a037455..cb40490f 100644 --- a/js/models/conversations.js +++ b/js/models/conversations.js @@ -27,7 +27,6 @@ return { unreadCount : 0, timestamp : timestamp, - active_at : timestamp }; }, @@ -180,7 +179,7 @@ }, archive: function() { - this.unset('active_at'); + this.set({active_at: null}); }, destroyMessages: function() { diff --git a/js/views/new_conversation_view.js b/js/views/new_conversation_view.js index c4ed12e6..0edf4797 100644 --- a/js/views/new_conversation_view.js +++ b/js/views/new_conversation_view.js @@ -93,7 +93,6 @@ createConversation: function() { var conversation = new Whisper.Conversation({ - active_at: null, id: this.getRecipients().at(0).id, type: 'private' }); diff --git a/js/views/recipients_input_view.js b/js/views/recipients_input_view.js index 62689f58..53f170e2 100644 --- a/js/views/recipients_input_view.js +++ b/js/views/recipients_input_view.js @@ -132,7 +132,6 @@ this.new_contact = new Whisper.ConversationListItemView({ el: this.$new_contact, model: new Whisper.Conversation({ - active_at: null, type: 'private', newContact: true })