diff --git a/app/javascript/flavours/glitch/components/avatar.js b/app/javascript/flavours/glitch/components/avatar.js index e3a838523..c5e9072c4 100644 --- a/app/javascript/flavours/glitch/components/avatar.js +++ b/app/javascript/flavours/glitch/components/avatar.js @@ -57,14 +57,14 @@ export default class Avatar extends React.PureComponent { backgroundSize: `${size}px ${size}px`, }; - let imageSrc = staticSrc; if (hovering || animate) { - imageSrc = src; + style.backgroundImage = `url(${src})`; + } else { + style.backgroundImage = `url(${staticSrc})`; } return ( - - +
); } diff --git a/app/javascript/mastodon/components/avatar.js b/app/javascript/mastodon/components/avatar.js index aa8b96895..570505833 100644 --- a/app/javascript/mastodon/components/avatar.js +++ b/app/javascript/mastodon/components/avatar.js @@ -53,14 +53,14 @@ export default class Avatar extends React.PureComponent { backgroundSize: `${size}px ${size}px`, }; - let imageSrc = staticSrc; if (hovering || animate) { - imageSrc = src; + style.backgroundImage = `url(${src})`; + } else { + style.backgroundImage = `url(${staticSrc})`; } return ( -