aboutsummaryrefslogtreecommitdiffstats
path: root/background_scripts/sync.coffee
diff options
context:
space:
mode:
authorStephen Blott2014-04-19 11:00:32 +0100
committerStephen Blott2014-04-19 11:00:32 +0100
commit222d53fe43e34d8d2fd7c2fd859de53cf5fee1f3 (patch)
tree7164c182d234b2a6006d238294dceb530c1af6af /background_scripts/sync.coffee
parent5ea93cd18611d859867bdd80c44c886d29a7b958 (diff)
downloadvimium-222d53fe43e34d8d2fd7c2fd859de53cf5fee1f3.tar.bz2
Delay initializing sync until other components have started.
Diffstat (limited to 'background_scripts/sync.coffee')
-rw-r--r--background_scripts/sync.coffee6
1 files changed, 4 insertions, 2 deletions
diff --git a/background_scripts/sync.coffee b/background_scripts/sync.coffee
index 3b34c5a6..b1ccb696 100644
--- a/background_scripts/sync.coffee
+++ b/background_scripts/sync.coffee
@@ -25,9 +25,11 @@ root.Sync = Sync =
storage: chrome.storage.sync
doNotSync: [ "settingsVersion", "previousVersion" ]
+ register: ->
+ chrome.storage.onChanged.addListener (changes, area) -> Sync.listener changes, area
+
init: ->
chrome.storage.onChanged.addListener (changes, area) -> Sync.listener changes, area
- @pull()
# Asynchronous fetch from synced storage, called only at startup.
pull: ->
@@ -126,5 +128,5 @@ root.Sync = Sync =
return false
return true
-Sync.init()
+Sync.register()