diff --git a/CHANGELOG.md b/CHANGELOG.md index 6f3ada13..deccc7b0 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -38,9 +38,10 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.1.0/). - (**Reader**) Fix "auto webtoon mode" detection for manga source languages other than english and the current selected language - (**Reader**) Fix the reader transition page previous chapter scanlator name showing the chapter name instead of the scanlator name - (**Reader**) Fix opening the previous/next chapter in the continuous horizontal mode with inverted reading direction -- (**Reader**) Fix scroll preservation in continuous horizontal mode with righ to left reading direction +- (**Reader**) Fix scroll preservation in continuous horizontal mode with right to left reading direction - (**Reader**) Fix mobile progress bar previous/next button not being clickable in single page chapters - (**Reader**) Fix scroll position jumping on chapter resume in the continuous horizontal mode +- (**Reader**) Fix page load retry button in continuous reading modes - (**Manga**) Fix dynamic manga page color theme not getting reset after leaving the manga page ## [20251230.01] (r2937) - 2025-12-30 diff --git a/src/base/components/SpinnerImage.tsx b/src/base/components/SpinnerImage.tsx index 74a1bc93..bf950145 100644 --- a/src/base/components/SpinnerImage.tsx +++ b/src/base/components/SpinnerImage.tsx @@ -75,14 +75,16 @@ export const SpinnerImage = ({ ref, ...props }: SpinnerImageProps) => { const showMissingImageIcon = !src.length; - const previousSrc = usePrevious(src); - const [imageSourceUrl, setImageSourceUrl] = useState(); const [imgLoadRetryKey, setImgLoadRetryKey] = useState(0); const [isLoading, setIsLoading] = useState(); const [hasError, setHasError] = useState(false); const [isVisible, setIsVisible] = useState(false); + const previousSrc = usePrevious(src); + const previousImgLoadRetryKey = usePrevious(imgLoadRetryKey); + const previousRetryKeyPrefix = usePrevious(retryKeyPrefix); + const updateImageState = (loading: boolean, error: boolean = false, aborted: boolean = false) => { setIsLoading(loading); setHasError(error); @@ -105,7 +107,15 @@ export const SpinnerImage = ({ ref, ...props }: SpinnerImageProps) => { const didSrcChange = previousSrc !== src; const isLoadedAndSrcUnchanged = !!imageSourceUrl && !didSrcChange; - if (showMissingImageIcon || !shouldLoad || isLoadedAndSrcUnchanged) { + const isLocalRetry = + hasError && previousImgLoadRetryKey !== undefined && previousImgLoadRetryKey !== imgLoadRetryKey; + const isGlobalRetry = + hasError && previousRetryKeyPrefix !== undefined && previousRetryKeyPrefix !== retryKeyPrefix; + const isRetry = isLocalRetry || isGlobalRetry; + + const finalShouldLoad = shouldLoad || isRetry; + + if (showMissingImageIcon || !finalShouldLoad || isLoadedAndSrcUnchanged) { return () => {}; }