Fix bug causing /item/null URLs

This commit is contained in:
Andrew Miner
2014-12-28 17:39:56 -08:00
parent 2ffd6274b7
commit a453712409
@@ -108,8 +108,11 @@ module.exports = class CraftingTableController extends BaseController
# Private Methods ##############################################################################
_craft: ->
router.navigate "/item/#{encodeURIComponent(@model.name)}"
@model.craft()
if @model.catalog.findRecipes(@model.name).length > 0
router.navigate "/item/#{encodeURIComponent(@model.name)}"
@model.craft()
else
router.navigate "/item"
_updateNameAutocomplete: ->
onChanged = => @onNameFieldChanged()