From eb0c07e3fcb989a549d2d0c10e461c2dcb11d2ac Mon Sep 17 00:00:00 2001 From: Beniamin Kalinowski Date: Sat, 20 Jan 2018 12:33:49 +0900 Subject: [PATCH] Setting up initial values for a cache. --- init.lua | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/init.lua b/init.lua index 473e381..a909dec 100644 --- a/init.lua +++ b/init.lua @@ -79,8 +79,8 @@ local function update(widget, reg, disablecache) -- Check for cached output newer than the last update local c = widget_cache[reg.wtype] - if c and c.time and c.data and t < c.time+reg.timer and not disablecache then return update_value(format_data(c.data)) + if c and t < c.time + reg.timer and not disablecache then elseif reg.wtype then if type(reg.wtype) == "table" and reg.wtype.async then if not reg.lock then @@ -238,7 +238,7 @@ end function vicious.cache(wtype) if wtype ~= nil then if widget_cache[wtype] == nil then - widget_cache[wtype] = {} + widget_cache[wtype] = { data = nil, time = 0 } end end end