Skip to content

Conversation

@cloudflypeng
Copy link
Contributor

Description

PR Type

  • Feature
  • Bugfix
  • Hotfix
  • Other (please describe):

Screenshots (if UI change)

Demo Video (if new feature)

before
Kapture 2025-07-05 at 15 36 28
after
Kapture 2025-07-05 at 15 43 14

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

  • I have updated the changelog/next.md with my changes.
@vercel
Copy link

vercel bot commented Jul 5, 2025

@cloudflypeng is attempting to deploy a commit to the RSS3 Team on Vercel.

A member of the Team first needs to authorize it.

const [currentSlideIndex, setCurrentSlideIndex] = useState(initialIndex)

// fallbackMap use in download to fix the cors image
const [fallbackMap, setFallbackMap] = useState<Record<string, string>>({})
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why is it a record?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

我想记录原本url和回退的url的映射,但是我现在觉得下载功能是不是应该放在FallbackableImage 那个组件里,而不是在wrapper那个组件里,这样这个pr就可以关掉了,但是要修改一下FallbackableImage

currentSrc === src ? "origin" : "proxy",
)

useEffect(() => {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This useEffect may cause some rendering issues; it should not be used here.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

2 participants