From df6c2d11326cc95346f5c8d2b25bc5238193631c Mon Sep 17 00:00:00 2001 From: Martin Edenhofer Date: Mon, 1 Dec 2014 19:18:15 +0100 Subject: [PATCH] Fixed not loaded ticket stats on object reload. --- .../app/controllers/widget/ticket_stats.js.coffee | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/app/assets/javascripts/app/controllers/widget/ticket_stats.js.coffee b/app/assets/javascripts/app/controllers/widget/ticket_stats.js.coffee index b2593c4b3..0d75592d2 100644 --- a/app/assets/javascripts/app/controllers/widget/ticket_stats.js.coffee +++ b/app/assets/javascripts/app/controllers/widget/ticket_stats.js.coffee @@ -14,12 +14,15 @@ class App.TicketStats extends App.Controller # subscribe and reload data / fetch new data if triggered if @user - @subscribeId = App.User.full( @user.id, @load, false, true ) + @subscribeIdUser = App.User.full( @user.id, @load, false, true ) else if @organization - @subscribeId = App.Organization.full( @organization.id, @load, false, true ) + @subscribeIdOrganization = App.Organization.full( @organization.id, @load, false, true ) release: => - App.User.unsubscribe(@subscribeId) + if @subscribeIdUser + App.User.unsubscribe(@subscribeIdUser) + if @subscribeIdOrganization + App.Organization.unsubscribe(@subscribeIdOrganization) load: (object) => if @organization