Deep watch messages to catch all updates

This commit is contained in:
James Allen 2014-07-15 18:32:18 +01:00
parent 57409df92b
commit 81eca79613
2 changed files with 2 additions and 2 deletions

View file

@ -5,9 +5,10 @@ define [
App.controller "ChatController", ($scope, chatMessages, @ide, $location) ->
$scope.chat = chatMessages.state
$scope.$watchCollection "chat.messages", (messages) ->
$scope.$watch "chat.messages", (messages) ->
if messages?
$scope.$emit "messages:updated"
, true # Deep watch
$scope.sendMessage = ->
chatMessages

View file

@ -39,7 +39,6 @@ define [
TIMESTAMP_GROUP_SIZE = 5 * 60 * 1000 # 5 minutes
prependMessage = (message) ->
console.log "PREPENDING MESSAGE", message
firstMessage = chat.state.messages[0]
shouldGroup = firstMessage? and
firstMessage.user.id == message.user.id and