Skip to content

Commit 799ecc3

Browse files
committed
FixImageQuality: fix webps not animating in chat
1 parent e70747c commit 799ecc3

1 file changed

Lines changed: 4 additions & 5 deletions

File tree

src/plugins/fixImagesQuality/index.tsx

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -74,11 +74,10 @@ export default definePlugin({
7474
const url = new URL(src);
7575
if (!url.pathname.startsWith("/attachments/")) return;
7676

77-
if (freeze) {
78-
url.searchParams.set("animated", "false");
79-
80-
if (url.pathname.endsWith(".gif"))
81-
url.searchParams.set("format", "webp");
77+
url.searchParams.set("animated", String(!freeze));
78+
if (freeze && url.pathname.endsWith(".gif")) {
79+
// gifs don't support animated=false, so we have no choice but to use webp
80+
url.searchParams.set("format", "webp");
8281
}
8382

8483
const isModal = !!trigger;

0 commit comments

Comments
 (0)