When changing a setting from DEFAULT to another value, the value was incorrectly wrapped in an array which lead to an invalid value to get set.
This then caused an error to be thrown, making the reader unusable
fixes#1099
Regression a7dcdd5651
"usePrevious" uses "useEffect" to update the ref while the fix of the commit updated the state during the render function call.
This causes the component to not actually render and immediately call the render function again. Which then leads to the "usePrevious" hooks "useEffect" to never getting called.
Regression 9ed05f3fc0
Due to the change to check if an image is cached, which is done async, it was possible that the image request was aborted before the request actually got queued.
In that case, the abort was called against the "noop" function and did not actually abort the triggered request.
Thus, after the image got queued, we have to optionally abort it again to ensure that the request really gets aborted.
In these modes the reader does not load leading pages to prevent the resulting layout shift on load.
This behavior prevented the retry button functionality.
Due to the way loading/failed pages are rendered and how the current page is detected, it's possible that the retry button for a leading page is visible, which resulted in showing a retry button without any functionality.
fixes#1088
When directly opening the source/extension browse page as the initial page, the metadata server settings weren't loaded yet, and thus, the default values were being used.
Thus, when opening the dialog the first time, it was showing the default selected languages.
When using blobs (e.g. due to authentication), manually refreshing caused the thumbnail to break on the manga page.
This was caused because the image got cleaned up, but did not get reloaded again because it was considered to be already loaded.
Regression 3a27461598
Lingui expects the codes to be compliant to BCP-47 while weblate was not set up to create the resource files in that format.
And react-i18next was able to just handle them.
fixes#1058
Switch to "lingui" for better DX.
Tried to persist existing languages as much as possible.
Removed "vite-plugin-node-polyfills" because it's incompatible with "lingui"
* feat(settings): refactor and implement KOReader Sync settings page
Refactors the KOReader Sync settings section into its own dedicated page and implements the full connection and configuration flow.
The previous implementation in the main server settings was outdated and incomplete. This change aligns the frontend with the latest backend logic and provides a complete user experience.
Key changes include:
- Separated the UI into two states: a login form for initial connection and a configuration panel for existing connections.
- Implemented `connectKoSyncAccount` and `logoutKoSyncAccount` mutations to handle authentication with the KOReader Sync server.
- Updated the `SERVER_SETTINGS` GraphQL fragment to use the new `koreaderSyncStrategyForward` and `koreaderSyncStrategyBackward` fields, removing the deprecated `koreaderSyncStrategy`.
- Moved all KOReader Sync settings from the generic Server Settings page to a dedicated route at `/settings/koreader-sync`.
- Restructured and improved i18n keys for better clarity and consistency.
Ran `yarn gql:codegen` to regenerate GraphQL types and helpers.
* Extract credentials login into component
* Update to server changes and cleanup
---------
Co-authored-by: schroda <50052685+schroda@users.noreply.github.com>
This caused the reader to "jump to random pages" because it caused the image to get unrendered and rendered again, leading to layout shifts.
This issue existed already for a long time but could only rarely be observed because of the hacky "cache check" logic.
The changes from 9ed05f3fc0 caused this issue to be consistent in case the new service worker could not get installed due to not meeting the required installation prerequisites. If that was the case, the cache check always returned false causing the above-described behavior.
fixes#929
The server is not requesting these images through an extension; thus, it is not a problem to send them directly to the server since there is no problem of getting the server "stuck" due to extension rate limits.
Improves the image request logic by making it possible to check if an image is cached.
In case an image is cached, it does not need to be put into the image queue because it won't be sent to the server.
In case the previous page in the history should be ignored, the back button just went back to the root page (library).
Instead, it should try to go back to the next page in the history until there is no page to go back to anymore.
With 12ef012e4b this has no benefit anymore, because the app now always checks if authentication is enabled by the server first before any other request can be sent.