Fix bug where "include tools" would always stay on
This commit is contained in:
@@ -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()
|
||||
|
||||
Reference in New Issue
Block a user