" : ""
}`;
else
- return `${i < 1 ? "" : ""}- ${this.getIngredientItem(
- e
- )}
${i == ings.length - 1 ? "
" : ""}`;
+ return `${i < 1 ? "" : ""}- ${this.getIng(e)}
${
+ i == ings.length - 1 ? "
" : ""
+ }`;
})
.join("");
};
@@ -1085,7 +1091,7 @@ export default {
r.tags.length
? `${localize(
"ts"
- )}
${this.getTags(r.tags)}
`
+ )}${this.getTags}`
: ""
} ${
this.hasTime(r.prepTime) || this.hasTime(r.cookTime)
@@ -1139,6 +1145,10 @@ export default {
},
// Helpers
+ touchRate({ object, action }, r) {
+ this.touchFade(object, action);
+ if (action == "up") this.rate(r);
+ },
touchYield({ object, action }) {
this.touchFade(object, action);
diff --git a/app/store.ts b/app/store.ts
index a8c8b719..5d6eaff4 100644
--- a/app/store.ts
+++ b/app/store.ts
@@ -1173,16 +1173,16 @@ export default new Vuex.Store({
}
},
toggleState(state, { id, key, setDate }) {
- let i = state.recipes.findIndex((e) => e.id == id)
- state.recipes[i][key] = state.recipes[i][key] ? 0 : 1
+ let res = state.recipes
+ let i = res.findIndex((e) => e.id == id)
+ state.recipes[i][key] = +!res[i][key]
db.execute(
- `UPDATE recipes SET ${key} = ${state.recipes[i][key]} WHERE id = '${id}'`
+ `UPDATE recipes SET ${key} = ${res[i][key]} WHERE id = '${id}'`
)
if (setDate) {
- state.recipes[i].lastTried = new Date().getTime()
- db.execute(
- `UPDATE recipes SET lastTried = ${state.recipes[i].lastTried} WHERE id = '${id}'`
- )
+ let time = new Date().getTime()
+ state.recipes[i].lastTried = time
+ db.execute(`UPDATE recipes SET lastTried = ${time} WHERE id = '${id}'`)
}
},
// UnLinkCombinations