From 91a32f9ebe577aace222f615e17e924018b232e5 Mon Sep 17 00:00:00 2001 From: Stephen Blott Date: Sat, 19 Apr 2014 07:54:09 +0100 Subject: Functional sync. --- background_scripts/sync.coffee | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'background_scripts') 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). -- cgit v1.2.3