aboutsummaryrefslogtreecommitdiffstats
path: root/background_scripts/sync.coffee
diff options
context:
space:
mode:
authorStephen Blott2014-04-19 10:02:14 +0100
committerStephen Blott2014-04-19 10:02:14 +0100
commit5ea93cd18611d859867bdd80c44c886d29a7b958 (patch)
treed8cde4be68d9c2ae2e0d73d6d8ebfd9eced52e04 /background_scripts/sync.coffee
parenta2de5078f8d34c2b65b451556aff07a6a41399a5 (diff)
downloadvimium-5ea93cd18611d859867bdd80c44c886d29a7b958.tar.bz2
Add remote sync test for setting cleared.
Diffstat (limited to 'background_scripts/sync.coffee')
-rw-r--r--background_scripts/sync.coffee7
1 files changed, 4 insertions, 3 deletions
diff --git a/background_scripts/sync.coffee b/background_scripts/sync.coffee
index 3a829722..3b34c5a6 100644
--- a/background_scripts/sync.coffee
+++ b/background_scripts/sync.coffee
@@ -56,7 +56,7 @@ root.Sync = Sync =
@log "ignoring: #{key}"
return
# Ignore, it's unchanged
- if localStorage[key] is value
+ if key of localStorage and localStorage[key] is value
@log "unchanged: #{key}"
return
@@ -64,7 +64,7 @@ root.Sync = Sync =
defaultValue = Settings.defaults[key]
defaultValueJSON = JSON.stringify(defaultValue)
- if value && value != defaultValueJSON
+ if value and value != defaultValueJSON
# Key/value has been changed to non-default value at remote instance.
@log "update: #{key}=#{value}"
localStorage[key] = value
@@ -72,7 +72,8 @@ root.Sync = Sync =
else
# Key has been reset to default value at remote instance.
@log "clear: #{key}"
- delete localStorage[key]
+ if key of localStorage
+ delete localStorage[key]
Settings.doPostUpdateHook key, defaultValue
# Only called synchronously from within vimium, never on a callback.