Merge branch 'VRFS-5181_latency_in_musician_hover_bubble' of bitbucket.org:jamkazam/jam-cloud into VRFS-5181_latency_in_musician_hover_bubble
This commit is contained in:
commit
724b76709a
|
|
@ -188,18 +188,12 @@
|
|||
}
|
||||
|
||||
function bindUserLatencyUpdate(userId){
|
||||
// var latency;
|
||||
$(document).on('user_latency_update', function(e, latencyResp){
|
||||
|
||||
logger.debug("bindUserLatencyUpdate", latencyResp);
|
||||
logger.debug("bindUserLatencyUpdate.userId", userId);
|
||||
|
||||
var userLatency = latencyResp.find(function(latency) {
|
||||
|
||||
var userLatency = latencyResp.users.find(function(latency) {
|
||||
return latency.user_id === userId;
|
||||
});
|
||||
|
||||
//logger.debug("bindUserLatencyUpdate", userLatency);
|
||||
|
||||
if(userLatency){
|
||||
showLatencyBadge(userLatency);
|
||||
}else{
|
||||
|
|
|
|||
|
|
@ -15,15 +15,13 @@ rest = new context.JK.Rest()
|
|||
onAppInit: (@app) ->
|
||||
|
||||
changed: () ->
|
||||
logger.debug("LatencyStore.latencies = ", @latencies)
|
||||
$(document).triggerHandler("user_latency_update", @latencies)
|
||||
@trigger(@latencies)
|
||||
$(document).triggerHandler("user_latency_update", { users: @latencies })
|
||||
@trigger(users: { @latencies })
|
||||
|
||||
onResolve: (user_ids) ->
|
||||
rest.getLatencyToUsers({user_ids: user_ids}).done((response) => @onLoaded(response)).fail((jqXHR) => @onLatencyFail(jqXHR, [user_ids]))
|
||||
|
||||
onLoaded: (response) ->
|
||||
logger.debug("LatencyStore.onLoaded response", response)
|
||||
usersLatencies = response.users
|
||||
@latencies = @latencies.concat(usersLatencies)
|
||||
@latencies = _.uniq(@latencies)
|
||||
|
|
|
|||
Loading…
Reference in New Issue