aboutsummaryrefslogtreecommitdiffstats
path: root/background_scripts/sync.coffee
diff options
context:
space:
mode:
authorStephen Blott2014-04-19 07:54:09 +0100
committerStephen Blott2014-04-19 07:54:09 +0100
commit91a32f9ebe577aace222f615e17e924018b232e5 (patch)
treeb716a1c535bd1c54c41a68244ea1ff603a4abf21 /background_scripts/sync.coffee
parent033d353b265fcd4e9963ef232c17d82d7bea43f1 (diff)
downloadvimium-91a32f9ebe577aace222f615e17e924018b232e5.tar.bz2
Functional sync.
Diffstat (limited to 'background_scripts/sync.coffee')
-rw-r--r--background_scripts/sync.coffee4
1 files changed, 3 insertions, 1 deletions
diff --git a/background_scripts/sync.coffee b/background_scripts/sync.coffee
index 40e0c5c3..e498172e 100644
--- a/background_scripts/sync.coffee
+++ b/background_scripts/sync.coffee
@@ -31,9 +31,10 @@ root.Sync = Sync =
# Asynchronous fetch from synced storage, called only at startup.
pull: ->
- @storage.get null, (items) ->
+ @storage.get null, (items) =>
if chrome.runtime.lastError is undefined
for own key, value of items
+ @log "pull: #{key} <- #{value}"
@storeAndPropagate key, value
else
@log "chrome sync callback for Sync.pull() indicates error"
@@ -42,6 +43,7 @@ root.Sync = Sync =
# Asynchronous message from synced storage.
listener: (changes, area) ->
for own key, change of changes
+ @log "listener: #{key} <- #{change.newValue}"
@storeAndPropagate key, change.newValue
# Only ever called from asynchronous synced-storage callbacks (pull and listener).