Skip to content

Commit

Permalink
Fix passing animation via param
Browse files Browse the repository at this point in the history
  • Loading branch information
FieryFlames committed Nov 22, 2023
1 parent 98cfb42 commit 8d3b3e6
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,8 @@ export default {
const decoration = await getDecoration(hash, env);
if (!decoration) return new Response('Decoration not found', { status: 404, headers: new Headers(BASE_HEADERS) });

const animate = decoration.animated && (url.searchParams.get("animate") === "true" ?? filename.startsWith('a_'));
const animateParam = url.searchParams.get("animate")
const animate = decoration.animated && ((!!animateParam && animateParam === "true") ?? filename.startsWith('a_'));

const object = await env.UGC.get(getFileName(hash, animate));
if (!object) return new Response('Not Found', { status: 404, headers: new Headers(BASE_HEADERS) });
Expand Down

0 comments on commit 8d3b3e6

Please sign in to comment.