From 45e427caf91250bcd7c6eaaaead1a433715c17b1 Mon Sep 17 00:00:00 2001 From: mmcwilliams Date: Mon, 12 Feb 2018 14:57:06 -0500 Subject: [PATCH] Reset state and then set newly reset state to web UI --- app/www/static/js/intval.web.js | 5 +---- index.js | 3 ++- 2 files changed, 3 insertions(+), 5 deletions(-) diff --git a/app/www/static/js/intval.web.js b/app/www/static/js/intval.web.js index a693a62..d798cff 100644 --- a/app/www/static/js/intval.web.js +++ b/app/www/static/js/intval.web.js @@ -168,15 +168,12 @@ web.reset = function () { } fetch('/reset', opts) .then(web.useJson) - .then(web.resetSuccess) + .then(setState) .catch(err => { console.error('Error posting to /reset'); console.error(err); }) }; -web.resetSuccess = function (res) { - console.dir(res) -} web.restart = function () { const opts = { method : 'POST', diff --git a/index.js b/index.js index 8184109..6d5b810 100644 --- a/index.js +++ b/index.js @@ -340,7 +340,8 @@ function rReset (req, res, next) { log.info(`/reset`, {time : +new Date()}) intval.reset() setTimeout(() => { - res.send(intval._state) + const obj = intval.status() + res.send(obj) return next() }, 10) }