fix: empty tool flag for pot

This commit is contained in:
YunYouJun
2022-04-15 22:19:16 +08:00
parent 5a2caf91b3
commit b078f9e6fa

View File

@@ -20,11 +20,13 @@ const displayedRecipe = computed(() => {
return recipe.value.filter((item) => {
if (strict.value) {
const stuffFlag = curStuff.value.every(stuff => item.stuff.includes(stuff))
return curTool.value ? stuffFlag && item.tools?.includes(curTool.value) : stuffFlag
const toolFlag = curTool.value ? item.tools?.includes(curTool.value) : true
return curTool.value ? stuffFlag && toolFlag : stuffFlag
}
else {
const stuffFlag = curStuff.value.some(stuff => item.stuff.includes(stuff))
return stuffFlag || item.tools?.includes(curTool.value)
const toolFlag = curTool.value ? item.tools?.includes(curTool.value) : true
return stuffFlag || toolFlag
}
})
})