Fix setArea never actually retrying after an error.

This commit is contained in:
Mayhem 2014-02-10 17:06:25 +01:00 committed by ccd0
parent 8643b8e9af
commit 79758ec37b

View File

@ -338,7 +338,7 @@ do ->
timeout = {}
setArea = (area) ->
data = items[area]
return if !Object.keys(data).length or timeout[area]
return if !Object.keys(data).length or timeout[area] > Date.now()
chrome.storage[area].set data, ->
if chrome.runtime.lastError
c.error chrome.runtime.lastError.message
@ -347,7 +347,8 @@ do ->
c.error chrome.runtime.lastError.message, key, val
continue
items[area][key] = val
timeout[area] = setTimeout setArea, $.MINUTE, area
setTimeout setArea, $.MINUTE, area
timeout[area] = Date.now() + $.MINUTE
return
delete timeout[area]
items[area] = {}