Skip to content

Bug fixing

FotieMConstant edited this page Aug 8, 2020 · 2 revisions

Bug fixing

Below is a list of bugs and how they were Fixed:

  • in controller.js Bug found:
Controller.prototype.adddItem

fixed to:

Controller.prototype.addItem
  • in index.html

Bug found:

<input class="toggle-all" type="checkbox">

fixed to:

<input class="toggle-all" id="toggle-all" type="checkbox">
  • in store.js

Bug found:

for (var i = 0; i < 6; i++) {
    newId += charset.charAt(Math.floor(Math.random() * charset.length));
  }

fixed to:

   var uniqueId = false;
   while(!uniqueId){
	for (var i = 0; i < 6; i++) {
             newId += charset.charAt(Math.floor(Math.random() * charset.length));
		}
	uniqueId = true;
	for (var i = 0; i < todos.length; i++) {
		if (todos[i].id == newId) {
			uniqueId = false;
		}
	}
   }
Clone this wiki locally