fix: download img support fallback src#4087
Open
cloudflypeng wants to merge 1 commit intoRSSNext:devfrom
Open
Conversation
|
@cloudflypeng is attempting to deploy a commit to the RSS3 Team on Vercel. A member of the Team first needs to authorize it. |
Innei
suggested changes
Jul 7, 2025
| const [currentSlideIndex, setCurrentSlideIndex] = useState(initialIndex) | ||
|
|
||
| // fallbackMap use in download to fix the cors image | ||
| const [fallbackMap, setFallbackMap] = useState<Record<string, string>>({}) |
Contributor
Author
There was a problem hiding this comment.
我想记录原本url和回退的url的映射,但是我现在觉得下载功能是不是应该放在FallbackableImage 那个组件里,而不是在wrapper那个组件里,这样这个pr就可以关掉了,但是要修改一下FallbackableImage
| currentSrc === src ? "origin" : "proxy", | ||
| ) | ||
|
|
||
| useEffect(() => { |
Contributor
There was a problem hiding this comment.
This useEffect may cause some rendering issues; it should not be used here.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
PR Type
Screenshots (if UI change)
Demo Video (if new feature)
before


after
Linked Issues
Additional context
When preview image, the download button use the cors href, but the FallbackableImage has the currentSrc to Proxy image,
so I rember the href and open it when download.
让下载按钮也可以使用到代理之后的连接, 防止图片无法访问
Changelog