Skip to content

Commit

Permalink
removed consoles
Browse files Browse the repository at this point in the history
  • Loading branch information
NitinRajput98 committed Apr 9, 2024
1 parent bb5652c commit dd9c1af
Show file tree
Hide file tree
Showing 3 changed files with 0 additions and 16 deletions.
8 changes: 0 additions & 8 deletions src/js/controller.js
Original file line number Diff line number Diff line change
Expand Up @@ -31,14 +31,9 @@ const controlRecipes = async function () {
recipeView.render(model.state.recipe);
} catch (err) {
recipeView.renderError();
console.error(err);
}
};

const newFeature = function () {
console.log('New feature');
};

const controlSearchResults = async function () {
try {
resultsView.renderSpinner();
Expand Down Expand Up @@ -99,8 +94,6 @@ const controlAddRecipe = async function (newRecipe) {

// Upload the new recipe data
await model.uploadRecipe(newRecipe);
console.log(model.state.recipe);

// Render recipe
recipeView.render(model.state.recipe);

Expand All @@ -118,7 +111,6 @@ const controlAddRecipe = async function (newRecipe) {
addRecipeView.toggleWindow();
}, MODAL_CLOSE_SEC * 1000);
} catch (err) {
console.error('πŸ’₯', err);
addRecipeView.renderError(err.message);
}
};
Expand Down
6 changes: 0 additions & 6 deletions src/js/model.js
Original file line number Diff line number Diff line change
Expand Up @@ -37,11 +37,8 @@ export const loadRecipe = async function (id) {
if (state.bookmarks.some(bookmark => bookmark.id === id))
state.recipe.bookmarked = true;
else state.recipe.bookmarked = false;

console.log(state.recipe);
} catch (err) {
// Temp error handling
console.error(`${err} πŸ’₯πŸ’₯πŸ’₯πŸ’₯`);
throw err;
}
};
Expand All @@ -51,8 +48,6 @@ export const loadSearchResults = async function (query) {
state.search.query = query;

const data = await AJAX(`${API_URL}?search=${query}&key=${KEY}`);
console.log(data);

state.search.results = data.data.recipes.map(rec => {
return {
id: rec.id,
Expand All @@ -64,7 +59,6 @@ export const loadSearchResults = async function (query) {
});
state.search.page = 1;
} catch (err) {
console.error(`${err} πŸ’₯πŸ’₯πŸ’₯πŸ’₯`);
throw err;
}
};
Expand Down
2 changes: 0 additions & 2 deletions src/js/views/View.js
Original file line number Diff line number Diff line change
Expand Up @@ -35,14 +35,12 @@ export default class View {

newElements.forEach((newEl, i) => {
const curEl = curElements[i];
// console.log(curEl, newEl.isEqualNode(curEl));

// Updates changed TEXT
if (
!newEl.isEqualNode(curEl) &&
newEl.firstChild?.nodeValue.trim() !== ''
) {
// console.log('πŸ’₯', newEl.firstChild.nodeValue.trim());
curEl.textContent = newEl.textContent;
}

Expand Down

0 comments on commit dd9c1af

Please sign in to comment.