From 5317b063bfa342dcab47780f0e95143148cba46c Mon Sep 17 00:00:00 2001 From: Joseph Huckaby Date: Mon, 4 Apr 2016 19:54:21 -0700 Subject: [PATCH] Fixed bug where "Run Again" button could sometimes freeze up UI if job completed immediately. Bumped version to 0.2.1. --- htdocs/js/pages/JobDetails.class.js | 4 +++- package.json | 2 +- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/htdocs/js/pages/JobDetails.class.js b/htdocs/js/pages/JobDetails.class.js index feeb547c..44600dd8 100644 --- a/htdocs/js/pages/JobDetails.class.js +++ b/htdocs/js/pages/JobDetails.class.js @@ -120,6 +120,7 @@ Class.subclass( Page.Base, "Page.JobDetails", { app.api.post( 'app/run_event', job, function(resp) { // app.showMessage('success', "Event '"+event.title+"' has been started."); self.jump_live_job_id = resp.ids[0]; + self.jump_live_time_start = hires_time_now(); self.jump_to_live_when_ready(); } ); }, @@ -129,10 +130,11 @@ Class.subclass( Page.Base, "Page.JobDetails", { var self = this; if (!this.active) return; // user navigated away from page - if (app.activeJobs[this.jump_live_job_id]) { + if (app.activeJobs[this.jump_live_job_id] || ((hires_time_now() - this.jump_live_time_start) >= 3.0)) { app.hideProgress(); Nav.go( 'JobDetails?id=' + this.jump_live_job_id ); delete this.jump_live_job_id; + delete this.jump_live_time_start; } else { setTimeout( self.jump_to_live_when_ready.bind(self), 250 ); diff --git a/package.json b/package.json index fd9be5aa..f4f9c40a 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "Cronicle", - "version": "0.2.0", + "version": "0.2.1", "description": "A simple, distributed task scheduler and runner with a web based UI.", "author": "Joseph Huckaby ", "homepage": "https://github.com/jhuckaby/Cronicle",