Bugs - latif-essam/todo-app-oc-project GitHub Wiki

There were 2 bugs to fix and 1 enhancement to add to this Application

Bugs

bug location Expected behvior Issue Solution
file line
1 contrroler.js 98 Preventing the app's functionalities from working The Controller adddItem method was misspelled rename the method from adddItem to addItem
2 store.js 115 there is a potential of conflict between creating duplicated IDs some ids may be the same. First Solution:
loop for higher numbers like 10, when generating the Ids, but this is not recommended.
Second Solution: use another function to generate a new id depending on the current time and date, like this:
 const generateId = () =>
      parseInt(Math.random().toString(10).substring(2)) + new Date().getTime();

Enhancement

In the Controller removeItem method there was a loop that log to the console the item's id that has been deleted

enhancment location Expected behvior Issue Solution
file line
1 contrroler.js 170 there is a for loop that logs the id of every item that has been deleted. this code is affecting the performance of the app and it's useless in the production mode. remove the code from the file
⚠️ **GitHub.com Fallback** ⚠️