remove unneccesary array length checks
This commit is contained in:
parent
df781bec00
commit
8ece85127a
@ -598,13 +598,10 @@ class RecipeWaiter {
|
|||||||
clearAllSelectedClasses() {
|
clearAllSelectedClasses() {
|
||||||
const list = document.querySelectorAll(".operation.selected");
|
const list = document.querySelectorAll(".operation.selected");
|
||||||
|
|
||||||
// check if any operations are selected at all to prevent errors
|
|
||||||
if (list.length) {
|
|
||||||
list.forEach((item) => {
|
list.forEach((item) => {
|
||||||
item.classList.remove("selected");
|
item.classList.remove("selected");
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Add "selected" to the operation that is added to the recipe
|
* Add "selected" to the operation that is added to the recipe
|
||||||
@ -642,7 +639,6 @@ class RecipeWaiter {
|
|||||||
|
|
||||||
this.clearAllSelectedClasses();
|
this.clearAllSelectedClasses();
|
||||||
|
|
||||||
if (recipeList.length) {
|
|
||||||
recipeList.forEach((ingredient) => {
|
recipeList.forEach((ingredient) => {
|
||||||
const ingredientName = ingredient.getAttribute("data-name");
|
const ingredientName = ingredient.getAttribute("data-name");
|
||||||
|
|
||||||
@ -653,7 +649,6 @@ class RecipeWaiter {
|
|||||||
});
|
});
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
export default RecipeWaiter;
|
export default RecipeWaiter;
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user