mirror of
https://ghfast.top/https://github.com/discourse/discourse-animated-avatars.git
synced 2026-05-28 01:24:03 +08:00
13 lines
397 B
JavaScript
13 lines
397 B
JavaScript
import { trustHTML } from "@ember/template";
|
|
import boundAvatar from "discourse/helpers/bound-avatar";
|
|
import { prefersReducedMotion } from "discourse/lib/utilities";
|
|
|
|
export default function (user, size) {
|
|
const avatar = boundAvatar(user, size);
|
|
|
|
if (!user.animated_avatar || prefersReducedMotion()) {
|
|
return avatar;
|
|
}
|
|
|
|
return trustHTML(avatar.toString().replace(/\.png/, ".gif"));
|
|
}
|