From 900b9b762a75d9ffb393ca7ba5feed7b289d0929 Mon Sep 17 00:00:00 2001 From: Jo-Philipp Wich Date: Tue, 22 Oct 2013 19:06:22 +0000 Subject: [PATCH] luci2: don't re-set timeout if view is finished already, re-set timeout even if the requested action failed --- luci2/htdocs/luci2/luci2.js | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/luci2/htdocs/luci2/luci2.js b/luci2/htdocs/luci2/luci2.js index 291af57..55de4c9 100644 --- a/luci2/htdocs/luci2/luci2.js +++ b/luci2/htdocs/luci2/luci2.js @@ -2420,11 +2420,12 @@ function LuCI2() var setTimer, runTimer; setTimer = function() { - self._timeouts[index] = window.setTimeout(runTimer, interval); + if (self._timeouts) + self._timeouts[index] = window.setTimeout(runTimer, interval); }; runTimer = function() { - _luci2.deferrable(func.call(self)).then(setTimer); + _luci2.deferrable(func.call(self)).then(setTimer, setTimer); }; runTimer(); -- 2.11.0