Really fix $.sync.

This commit is contained in:
ccd0 2015-02-17 20:22:23 -08:00
parent 3ba1bd247d
commit aa9d0cf7c5

View File

@ -319,7 +319,7 @@ chrome.storage.onChanged.addListener (changes, area) ->
newValue = $.oldValue.local[key] ? $.oldValue.sync[key]
cb = $.syncing[key]
if cb and JSON.stringify(newValue) isnt JSON.stringify(oldValue)
cb changes[key].newValue, key
cb newValue, key
return
$.sync = (key, cb) ->
$.syncing[key] = cb