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

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