Prevent triggering load of already loaded image

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
This commit is contained in:
schroda
2025-11-28 22:49:35 +01:00
parent d0735365ff
commit 3a27461598
2 changed files with 3 additions and 2 deletions

View File

@@ -36,7 +36,8 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.1.0/).
- (**Reader**) Fix mouse cursor drift during drag scroll
- (**Reader**) Fix deletion of chapters while reading
- (**Reader**) Fix potential page loss (continuous horizontal mode window resize, reader width change, page scale change)
(**Reader**) Fix current page detection in continuous horizontal mode with right-to-left reading mode
- (**Reader**) Fix current page detection in continuous horizontal mode with right-to-left reading mode
- (**Reader**) Fix occasionally jumping to random pages in continuous reading modes
- (**Extension**) Fix handling obsolete extensions as updatable in case they are marked as having an available update
- (**Theme**) Fix loading of fonts defined in themes
- (**Reader**) Fix broken scrolling in continuous horizontal reading mode

View File

@@ -96,7 +96,7 @@ export const SpinnerImage = ({ ref, ...props }: SpinnerImageProps) => {
);
useEffect(() => {
if (showMissingImageIcon || !shouldLoad) {
if (showMissingImageIcon || !shouldLoad || !!imageSourceUrl) {
return () => {};
}