gbowne1 / codebooker

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

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Bug: Home Page Not Displaying Books from Database and Loading Spinner Issue.

BlackBond06 opened this issue · comments

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.

@gbowne1 This issue should be deleted from the issues tab. It has been closed.

Ok @BlackBond06.

Closing this as completed.