mirror of
https://github.com/overleaf/overleaf.git
synced 2024-11-07 20:31:06 -05:00
Deep watch messages to catch all updates
This commit is contained in:
parent
57409df92b
commit
81eca79613
2 changed files with 2 additions and 2 deletions
|
@ -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
|
||||
|
|
|
@ -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
|
||||
|
|
Loading…
Reference in a new issue