This is a book recommendation app created with React 18.2 and MUI for coders/programmers looking for reccomendations to books on programming/coding to read
MIT License
31
stars
57
forks
source link
Bug: Home Page Not Displaying Books from Database and Loading Spinner Issue. #193
The current behavior of the home page is not in line with the expected functionality. Instead of rendering books fetched from the database, it continuously displays the loading spinner without presenting any books on the UI.
The reason for this current behavior is, at line 613 of the Library.jsx component, books fetched from the db are displayed if the db is not empty (there must be at least one book). Else, the loading spinner is displayed. There is currently no book in the db, which is why the loading spinner is continuously running.
To fix this issue, the following changes are recommended:
While waiting for a response from the database, the loading spinner should be displayed.
if there are books in db, display it.
In cases of database errors or when the database is unavailable, populate the UI with books from data.json.
else, display an "Add Book " button, along with a message politely informing the user that no books are currently stored in the database.
The current behavior of the home page is not in line with the expected functionality. Instead of rendering books fetched from the database, it continuously displays the loading spinner without presenting any books on the UI.
The reason for this current behavior is, at line 613 of the Library.jsx component, books fetched from the db are displayed if the db is not empty (there must be at least one book). Else, the loading spinner is displayed. There is currently no book in the db, which is why the loading spinner is continuously running.
To fix this issue, the following changes are recommended: