From bd6c9c1fbd7fc0591020f88ac11dac959d474093 Mon Sep 17 00:00:00 2001 From: Damien De Paoli Date: Sat, 25 Oct 2025 10:52:30 +1100 Subject: [PATCH] code formatting --- internal/js/jobs.js | 14 ++++---------- 1 file changed, 4 insertions(+), 10 deletions(-) diff --git a/internal/js/jobs.js b/internal/js/jobs.js index ccac0b6..d5a2347 100644 --- a/internal/js/jobs.js +++ b/internal/js/jobs.js @@ -75,17 +75,11 @@ function CheckForJobs() { type: 'POST', url: '/check_for_jobs', success: function(data) { - data.sts.forEach( - function(el) - { - StatusMsg(el) - } - ) + // for each status, handle it/make toast in UI + data.sts.forEach( function(el) { StatusMsg(el) } ) SetActiveJobsBadge(data.num_active_jobs) - if( data.num_active_jobs > 0 ) - { - setTimeout( function() { CheckForJobs() }, 1000 ); - } + // still active job(s), keep checking for them to end + if( data.num_active_jobs > 0 ) { setTimeout( function() { CheckForJobs() }, 1000 ); } }, } ) return false;