diff options
| author | Stephen Blott | 2014-04-19 00:13:36 +0100 |
|---|---|---|
| committer | Stephen Blott | 2014-04-19 00:13:36 +0100 |
| commit | 654738cb4d566c5e0b2d1e229dd9055403af35f6 (patch) | |
| tree | 5b9997fdfce03452f51ee8896470dbd726571339 | |
| parent | 75234c78cf13be08608ccd2b6bcecf2757b199ff (diff) | |
| download | vimium-654738cb4d566c5e0b2d1e229dd9055403af35f6.tar.bz2 | |
Code review of Sync().
| -rw-r--r-- | background_scripts/settings.coffee | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/background_scripts/settings.coffee b/background_scripts/settings.coffee index 063287db..ad89888e 100644 --- a/background_scripts/settings.coffee +++ b/background_scripts/settings.coffee @@ -7,14 +7,14 @@ root.Settings = Settings = get: (key) -> if (key of localStorage) then JSON.parse(localStorage[key]) else @defaults[key] - set: (key, value, doNotSync) -> + set: (key, value) -> # don't store the value if it is equal to the default, so we can change the defaults in the future if (value == @defaults[key]) @clear(key) else - jsonified = JSON.stringify value - localStorage[key] = jsonified - root.Sync.set key, jsonified + jsonValue = JSON.stringify value + localStorage[key] = jsonValue + root.Sync.set key, jsonValue clear: (key) -> if @has key |
