* [Cleanup] Improve variable names
* [Cleanup] Improve typing
* [Cleanup] Extract source sort by name logic into function
* Do not sort original loaded source list
"Sort" mutates the original array
* [Cleanup] Extract search result sort logic into function
* [Cleanup] Simplify adding default languages to shown languages
* Fix RequestManager initial infinite swr requests
Functions always returned "null" as the url, which causes SWR to not send the request
- useGetSourceLatestMangas
- useSourceSearch
- useSourceQuickSearch
* Use "skipRequest" for infinite SWR requests
Is easier to use then overwriting "getEndpoint" only for specific cases
* Request correct first page for infinite SWR requests
The following endpoints start at page 1
- popular source mangas
- latest source mangas
- source search
- source quick search
* Remove wrong parameter from source manga browse requests
No idea why I've added this in the first place
* Correctly request "latest" and "popular" source mangas
The "page" wasn't a param of the query but part of the endpoint
* Use "RequestManager" for loading updates
* [Cleanup] Fix typing
* Memoize grouped updates
* [TSConfig] Increase target version
Makes it possible to iterate over a "IterableIterator" (e.g. [...<Map>.entries()])
* Use "GroupedVirtuoso" for "Updates" screen
* Optionally use "padding" instead of margin for the loading placeholder
In case the loading placeholder gets used in a "react-virtuoso" list, the margin might cause issues with the calculated height.
* Use "padding" instead of "margin"
"Margin" breaks "react-virtuosos" height calculation
* Add background color to group header
With virtuoso the group headers are sticky, thus, a background color is needed
* Simplify "groupByDate" object structure
It's not necessary to save the items inside the group object
* Introduce "RequestManager"
* Use "RequestManager" - Simple replacements
- Get rid of all "util/client" imports
- replace old requests with new "RequestManager"
- remove "fetcher" from global SWR config
instead of using the SWR hooks by themselves, the "requestManager" is supposed to be used
* Use "RequestManager" - Do requests via SWR hooks
Use SWR hooks at places where it's easily usable
* Prevent trailing slashes in the "baseUrl"
Due to using "useEffect" the grid always rendered once with stale data, causing the error message to be shown.
With "useMemo" the latest data is always getting rendered immediately.
When selecting chapters the FAB button slightly moved further up and to the left.
This happened because "em" was used for the positioning and the "SelectionFAB" being inside a "Box" component while the "Start/ResumeFAB" had "no extra" parent component.
* [Cleanup] Use async/await
* Show download queue removal error toast
* Optionally restart download queue after removing download
When removing a download while the download queue was running, the queue was never started again.
* Update SWR to version 2.1.5
* Improve generic type names
* Use "isLoading" property of "useSWR" response
* Correctly load library without selected tab
With the latest SWR version the library was empty on the first load.
Not sure what exactly is the reason, but due to "isPaused" the request wasn't sent even after "activeTab" wasn't undefined anymore.
Instead of using "isPaused", passing "null" as the key will also prevent SWR from doing the request.
* Pass optional browser tab only title
Makes it possible to have a different title for the "NavBar" and the browser tab
* Show number of items in category and library
---------
Co-authored-by: schroda <github@dasch.simplelogin.com>
* [Cleanup] Add enums and types
* Extract "default languages" from ISOLanguages
The "default languages" will also be translated depending on which language the user selected
* [ChapterCard] Reset last page read to first page when changing chapters read status
The last page read was set to the second page instead of the first one
* [ChapterList] Reset last page read to first page when changing chapters read status
The "ChapterCard" and the "FAB" didn't have the same behaviour when marking a chapter as unread.
The "ChapterCard" also reset the last read page while the FAB only changed the read status.
* Skip duplicate chapters in the Reader
* Debounce "end of page" handling in the reader
* Update keyboard event listener
In case the "go" function changed, the listeners have to be updated