From a4e8368cc144d12fc1314d9248a59fc918aa6c8f Mon Sep 17 00:00:00 2001 From: nelsonic Date: Sun, 12 Apr 2015 19:58:21 +0100 Subject: [PATCH] adds clarifying comments. https://github.com/ideaq/time/issues/120 --- front/public/js/alpha.js | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/front/public/js/alpha.js b/front/public/js/alpha.js index 3b85c474..ee8320ac 100644 --- a/front/public/js/alpha.js +++ b/front/public/js/alpha.js @@ -35,10 +35,11 @@ $(document).ready(function() { success: function(res, status, xhr) { console.log(' - - - - - - - - timerupsert res:') console.log(res); - if(active && active.id === res.id){ - active = res; + // only update the active timer if response is updating it + if(active && active.id === res.id) { // i.e. not for description updates + active = res; // see: https://github.com/ideaq/time/issues/120 + db.set('active', res); } - db.set('active', res) saveTimer(res); // add it to our local db of timers callback(); },