-
-
Notifications
You must be signed in to change notification settings - Fork 126
London | May 2025 | Sisay Mehari | Sprint 2 | Book Library Debugging #241
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
…rect 'myLibrary' in submit() to ensure new books are added properly.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good work on debugging the problems. Remember the readme says there are other bugs than the ones mentioned. I've left some pointers for where you might find them
debugging/book-library/script.js
Outdated
| wasReadCell.appendChild(changeBut); | ||
| let readStatus = ""; | ||
| if (myLibrary[i].check == false) { | ||
| if (myLibrary[i].check == true) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
if .check is a boolean, do you need to compare it to == true?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We do not need to compare it.
| pages.value == null || | ||
| pages.value == "" | ||
| ) { | ||
| alert("Please fill all fields!"); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is there any input validation missing from the pages? What about the author?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I have done all the input validation.
debugging/book-library/script.js
Outdated
| delButton.className = "btn btn-warning"; | ||
| delButton.innerHTML = "Delete"; | ||
| delButton.addEventListener("click", function () { | ||
| alert(`You've deleted title: ${myLibrary[i].title}`); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
can you think of a better user interaction than alert() here? Deleting something can be pretty bad, and being notified after a delete has happened isnt usually what you see.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I have added a warning to notify before deleting it.
|
Great work on this -you are done with this task now |
Learners, PR Template
Self checklist
Changelist
✅ What I’ve Done
This pull request addresses multiple bugs in the Book Library project:
🔧 Bug Fixes
Books not showing on load
render()afterpopulateStorage()to ensure books display correctly when the page loads.Error in console when adding a book
library.push(...)with the correctmyLibrary.push(...)in thesubmit()function.Title used instead of author
Book()constructor arguments to passauthor.valueinstead of mistakenly usingtitle.valuetwice.No question at the moment.