Improve moval messages to history

pull/146/head
Rodrigo Nascimento 11 years ago
parent f893f17643
commit 02e8de6c36
  1. 7
      client/lib/collections.coffee
  2. 14
      client/views/app/chatWindowDashboard.html

@ -3,5 +3,10 @@
Meteor.startup ->
ChatMessage.find().observe
added: (record) ->
if ChatMessageHistory._collection._docs._map[record._id]?
ChatMessageHistory.remove record._id
removed: (record) ->
ChatMessageHistory.upsert { _id: record._id }, record
if not ChatMessageHistory._collection._docs._map[record._id]?
ChatMessageHistory.insert record

@ -29,12 +29,14 @@
</li>
{{/if}}
{{#each messagesHistory}}
{{#if newDateHistory}}
<li class="date">
<span>{{messageDate}}</span>
</li>
{{/if}}
{{> chatMessageDashboard data=this}}
{{#unless showTyping}}
{{#if newDateHistory}}
<li class="date">
<span>{{messageDate}}</span>
</li>
{{/if}}
{{> chatMessageDashboard data=this}}
{{/unless}}
{{/each}}
{{#each messages}}
{{#unless showTyping}}

Loading…
Cancel
Save