* Disable ssr by default for "useMediaQuery"
SSR would cause the hook to run once with default values and only after the first render with real values.
This can cause issue on rendering when depending on useMediaQuery results like in 8c129f2e08
* Virtualize manga grids
* Remove SourceMangas load more guard
Was required due to the previous load more trigger logic from the MangaGrid.
Due to using Virtuoso now, load more will be triggered only once when the bottom of the grid was reached and thus won't trigger multiple load more requests
* Remove old Library pagination
Pagination is handled by virtuoso, thus, the previous pagination can be removed
* Increase initial loaded pages to make infinite load work
virtuoso requires enough initial items to be rendered, so that actual virtualization takes effect, for it to fire "endReached"
* Prevent virtuoso grid scrollbar from jumping around
In case the items have a big height difference there is a bug where the scrollbar starts jumping around the moment these new items are rendered
* Restore scroll position
For some reason the UI jumps around when accessing "document.documentElement" during loading more items.
After the items are rendered the loading placeholder gets removed and the previous items jump to the bottom of the viewport.
* Limit manga grid titles to two lines
* Remove "last page" info from MangaGrid
Info is not needed. The only thing the MangaGrid has to do is to trigger a request to load more data
There was an issue when switching from the "search" back to the "filter" source content type.
The "filter" request returned the data from the search request and thus, showed invalid data until the correct data was loaded instead of showing the loading placeholder
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.