From 47c7cf693a87168fb86b2160788f026d7f516322 Mon Sep 17 00:00:00 2001 From: Andrew Miner Date: Mon, 12 Jan 2015 14:21:34 -0800 Subject: [PATCH] Fix bug where "include tools" would always stay on --- src/scripts/models/crafting_plan.coffee | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/scripts/models/crafting_plan.coffee b/src/scripts/models/crafting_plan.coffee index 190f1d3ef..bde0df73a 100644 --- a/src/scripts/models/crafting_plan.coffee +++ b/src/scripts/models/crafting_plan.coffee @@ -16,7 +16,6 @@ module.exports = class CraftingPlan extends BaseModel options.storage ?= window.localStorage if not attributes.modPack then throw new Error 'modPack is required' - attributes.includingTools ?= options.storage.getItem('includingTools') attributes.includingTools ?= false super attributes, options @@ -29,6 +28,9 @@ module.exports = class CraftingPlan extends BaseModel @have.on 'change', => @craft() @want.on 'change', => @craft() @modPack.on 'change', => @craft() + + value = options.storage.getItem('includingTools') + if value? then @includingTools = value is 'true' @on 'change:includingTools', => @onIncludingToolsChanged() @clear()