ImageZoom: load attachments from cdn instead of media proxy
This commit is contained in:
parent
16f343be52
commit
74f106c9fc
1 changed files with 3 additions and 0 deletions
|
|
@ -162,6 +162,9 @@ export const Magnifier = ErrorBoundary.wrap<MagnifierProps>(({ instance, size: i
|
|||
const imageSrc = useMemo(() => {
|
||||
try {
|
||||
const imageUrl = new URL(instance.props.src);
|
||||
if (imageUrl.pathname.startsWith("/attachments/"))
|
||||
imageUrl.hostname = "cdn.discordapp.com";
|
||||
|
||||
imageUrl.searchParams.set("animated", "true");
|
||||
return imageUrl.toString();
|
||||
} catch {
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue