internetarchive / internetarchive/bookreader
Bookmarks XHR should not be fetching unless user is signed in
- Dominant language
- JavaScript
- Stars
- 1.2k
- Forks
- 491
- Avg merge
- 2d 15h
- Merged PRs (30d)
- 3
Description
**Problem**
- with incognito window, go to: https://archive.org/details/goody
- open console -> you see a 401 return for bookmarks call
- spin up BookReader's demo server -> go to Internet Archive `http://127.0.0.1:8080/BookReaderDemo/demo-internetarchive.html?ocaid=theworksofplato01platiala`
- open console -> you see a 404 return for bookmarks call
**Expectation**
- if user is not signed in, do not fire XHR call
- if user is signed in, request bookmarks appropriately=
**Proposal & Constraints**
check `ia-bookmarks.js` -> note that we pass in a property `displayMode` - https://github.com/internetarchive/bookreader/blob/master/src/BookNavigator/bookmarks/ia-bookmarks.js#L100
let's try:
- changing `displayMode` default from `bookmarks` to `login`
- ensure that the initial API call does not get fired until `displayMode` flips to `login`
This can be handled in the lit element's life cycle `updated`, perhaps.
**Stakeholders**
@dualcnhq @iisa
Contributor guide
Assessment
This issue has not been assessed yet.