From: Jo-Philipp Wich Date: Tue, 22 Oct 2013 19:06:22 +0000 (+0000) Subject: luci2: don't re-set timeout if view is finished already, re-set timeout even if the... X-Git-Url: http://git.lede-project.org./?a=commitdiff_plain;h=900b9b762a75d9ffb393ca7ba5feed7b289d0929;p=project%2Fluci2%2Fui.git luci2: don't re-set timeout if view is finished already, re-set timeout even if the requested action failed --- 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();