Fix setArea never actually retrying after an error.
This commit is contained in:
parent
8643b8e9af
commit
79758ec37b
@ -338,7 +338,7 @@ do ->
|
|||||||
timeout = {}
|
timeout = {}
|
||||||
setArea = (area) ->
|
setArea = (area) ->
|
||||||
data = items[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, ->
|
chrome.storage[area].set data, ->
|
||||||
if chrome.runtime.lastError
|
if chrome.runtime.lastError
|
||||||
c.error chrome.runtime.lastError.message
|
c.error chrome.runtime.lastError.message
|
||||||
@ -347,7 +347,8 @@ do ->
|
|||||||
c.error chrome.runtime.lastError.message, key, val
|
c.error chrome.runtime.lastError.message, key, val
|
||||||
continue
|
continue
|
||||||
items[area][key] = val
|
items[area][key] = val
|
||||||
timeout[area] = setTimeout setArea, $.MINUTE, area
|
setTimeout setArea, $.MINUTE, area
|
||||||
|
timeout[area] = Date.now() + $.MINUTE
|
||||||
return
|
return
|
||||||
delete timeout[area]
|
delete timeout[area]
|
||||||
items[area] = {}
|
items[area] = {}
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user