From 654738cb4d566c5e0b2d1e229dd9055403af35f6 Mon Sep 17 00:00:00 2001 From: Stephen Blott Date: Sat, 19 Apr 2014 00:13:36 +0100 Subject: Code review of Sync(). --- background_scripts/settings.coffee | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'background_scripts') 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 -- cgit v1.2.3