Skip to content

Commit

Permalink
Fixes condition for adding message to channel
Browse files Browse the repository at this point in the history
Signed-off-by: Akash Manohar J <akash@akash.im>
  • Loading branch information
HashNuke committed Apr 13, 2012
1 parent 2f9ea7e commit 74285fd
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions app/assets/javascripts/backbone/helpers/channels.js.coffee
Expand Up @@ -117,11 +117,11 @@ class Kandan.Helpers.Channels

@addMessage: (activityAttributes, state, local)->
belongsToCurrentUser = ( activityAttributes.user.id == Kandan.Data.Users.currentUser().id )
activityExists = ( $("#activity-#{activityAttributes.id}").length == 0 )
activityExists = ( $("#activity-#{activityAttributes.id}").length > 0 )
local = local || false
console.log !local, !belongsToCurrentUser, !activityExists

console.log local, !belongsToCurrentUser, !activityExists
if local || (!belongsToCurrentUser || !activityExists)
if local || (!local && !belongsToCurrentUser && !activityExists)
@channelActivitiesEl(activityAttributes.channel_id)
.append(@newActivityView(activityAttributes).render().el)

Expand Down

0 comments on commit 74285fd

Please sign in to comment.