SearchAll used a different search endpoint and thus, the already requested pages for the search weren't reused and instead had to be requested again since the swr cache key was different
In case more than 1 page was requested for the initial request, there was a problem in case the first page already had no results.
In that case the request for the second page always returned with the "isLoadMore" and "isLoading" flag set to true.
Thus, incorrectly indicating that the request is still active.
The "actual" request was already finished, but internally the "isLoadMore" flag was set incorrectly due to not considering if an actual request is active.
* Correctly handle missing location state
In case the view gets opened directly via url, there won't be any location state.
This leads to a TypeError when trying to get "contentType" from the location state.
Issue was introduced with 4e8813b526 where the function was adapted incorrectly with code that will never work (good job me KEKW)
* Add info about dev mode + strict mode issue
* Prevent dialog not to showing any categories after updating them
After updating to react v18 the dialog categories were empty after updating the category changes
* Immediately close the dialog after starting update
Catalog was open as long as the update was running
* Remove unnecessary state
* Remove "useBackTo"
Not needed
* Use browser back navigation to close the reader
This will cause the previous page (manga or updates) to be opened instead of always opening the manga page
This caused the chapter to be loaded with stale data (the old lastPageRead state) and then jumping to the actual lastPageRead after the latest data was received.
It's not possible to mutate the chapter when updating lastPageRead since this causes the reader to always jump back to the just set lastPageRead when scrolling
With the recent update to react-router-dom v6 the route "manga/:mangaId/chapter/:chapterIndex/page/:pageIndex" doesn't get matched anymore.
The "pageIndex" is also unnecessary since it doesn't get used and instead the chapters "lastReadPage" property gets used to resume the chapter.
Due to setting the "defaultBackTo" url the back button was a Link instead of a normal Button.
The Link causes the page to get opened like it's the first time and to get put on top of the browsers history stack. Instead of actually going back in the history.
Thus, the previous location state of the "SourceMangas" page was lost and the content type (browse, latest, filter) couldn't be reopened.
* Use alias "@" for imports
* Use alias "@" for imports - Fix imports
* Use alias "@" for imports - Prevent faulty "import/extensions" linting issue
For some reason the rule throws an error for alias imports
* Use alias "@" for imports - Update "no-relative-imports" eslint rule
* Update dependency "react" to v18.x
Update to v18.2.0
* Update dependency "react" to v18.x - Fix some dependency version issue
Something caused weird tsc issues, most likely a version mismatch since it got fixed by doing a clean install (deleting node_modules folder, yarn.lock and clearing the cache) of the dependencies
* Update dependency "react" to v18.x - Fix "i18n" tsc issues
* Update dependency "react" to v18.x - Fix tsc issue
Typography can only have a single child
* Update dependency "react" to v18.x - Prevent build warning
TODO: migrate to Vite
Gets used without being declared as a dependency.
Since CRA is unmaintained this will not get fixed.
* Update dependency "react" to v18.x - Use "createRoot"
* Update dependency "react" to v18.x - Fix dnd in strict mode
* Update dependency "react-router-dom" to v6.x
Update to v6.11.2
* Update dependency "react-router-dom" to v6.x - Replace "Switch" with "Routes"
* Update dependency "react-router-dom" to v6.x - Relative paths
* Update dependency "react-router-dom" to v6.x - Nested routes
* Update dependency "react-router-dom" to v6.x - Prevent route warnings
- Route without an element causes a warning message.
- Routes with non-matching Route causes a warning message.
* Update dependency "react-router-dom" to v6.x - Replace "useHistory" with "useNavigate"
* Update dependency "react-router-dom" to v6.x - Fix "Link" usage
* Update dependency "react-router-dom" to v6.x - Overwrite "useParams" and "useLocations" typing
For both functions it's the users fault if they are getting used incorrectly.
It's inconvenient to always have to make sure the params exist (useParam) or to cast the return object to a specific type (useLocation)
- "useParams": Make generic type non-optional
- "useLocation": Add generic type
* Update dependency "react-router-dom" to v6.x - Fix use-query-params provider
* Update dependency "mui" to v5.x
Update to v5.13.3
Fixes issue of "SxProps" not being exported by "@mui/material"
* Update dependency "mui" to v5.x - Fix grid item size
Update to v5.13.3
Fixes issue of "SxProps" not being exported by "@mui/material"
* Update dependency "mui" to v5.x - Replace "ListItem" with "ListItemButton"
* Update dependency "mui" to v5.x - Fix tsc issue
* Update dependency "mui" to v5.x - Prevent reader white screen
Due to "initialChapter" being a function returning an object, it causes a re-render everytime due to it (the object) being used as a dependency.
This caused a white screen when skipping to the previous or next chapter
* Remove "getClient" usage from "metadata" util
* Remove "getClient" usage from "useRefreshManga" hook
* Remove "getClient" usage from "isDupChapter" util function
* Use correct endpoint for setting category metadata
"/meta" suffix was missing from url
* Use correct http method for updating manga metadata
The response was the expected data and not the actual axios response.
Thus, there was no "data" property and trying to use it could lead to errors like e.g. TypeErrors.
* Refactor "SourceMangas"
* Refactor "SourceMangas" - Show loading placeholder on filter reset or submit
Due to the url being the same for all "filter requests" the loading state doesn't get changed by SWR.
Instead, only the "isValidating" state gets updated.
* Refactor "SourceMangas" - Update routing
* Refactor "SourceMangas" - Prevent duplicated mangas in grid
There is a possibility that the "latest" endpoint returns the same manga on different pages
* Always set the toolbar content on the manga page
"setAction" wasn't called on the manga page, thus, in case the previous page didn't unset the action, it never got unset
* Rename source content type "Browse" to "Popular"
* Prevent mutating passed object
Causes the options to not get reset correctly and/or to get set without "submitting" them
* Always use local filter state instead of requested one
The local filter state sometimes got overwritten by the state from the server response.
This resulted in showing an incorrect filter state while still sending the correct one to the server when filtering
* Update text filter faster
The timeout (2.5s) is too long and can cause the filter state to not have been updated by the time the filters are getting submitted.
Thus, causing a request with outdated filters and requiring a "re-submit" for the actual filters to get used.
The SWR response only has "isLoading" and "isValidating".
"isLoading" only indicates the initial load.
For every subsequent load, only "isValidating" gets set to true.