From 97da56d02bbe9c0f3aca8f46fcb7bf8635a9e784 Mon Sep 17 00:00:00 2001 From: Eugen Rochko Date: Wed, 25 Jan 2017 17:23:17 +0100 Subject: [PATCH] Fix loading of avatars before drawing them to canvas --- app/assets/javascripts/components/components/avatar.jsx | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/app/assets/javascripts/components/components/avatar.jsx b/app/assets/javascripts/components/components/avatar.jsx index 30467da4d..b8420014b 100644 --- a/app/assets/javascripts/components/components/avatar.jsx +++ b/app/assets/javascripts/components/components/avatar.jsx @@ -24,7 +24,7 @@ const Avatar = React.createClass({ this.setState({ hovering: false }); }, - componentDidMount () { + handleLoad () { this.canvas.getContext('2d').drawImage(this.image, 0, 0, this.props.size, this.props.size); }, @@ -41,7 +41,7 @@ const Avatar = React.createClass({ return (
- +
);