Fix custom emoji render (#2075)

This commit is contained in:
Elias Nahum 2018-09-05 10:04:59 -03:00 committed by GitHub
parent 65fce2a680
commit 688d6579d0
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -57,10 +57,10 @@ export default class Emoji extends React.PureComponent {
}
componentWillMount() {
const {displayTextOnly, imageUrl} = this.props;
const {displayTextOnly, emojiName, imageUrl} = this.props;
this.mounted = true;
if (!displayTextOnly && imageUrl) {
ImageCacheManager.cache(imageUrl, imageUrl, this.setImageUrl);
ImageCacheManager.cache(`emoji-${emojiName}`, imageUrl, this.setImageUrl);
}
}
@ -74,7 +74,7 @@ export default class Emoji extends React.PureComponent {
if (!displayTextOnly && imageUrl &&
imageUrl !== this.props.imageUrl) {
ImageCacheManager.cache(imageUrl, imageUrl, this.setImageUrl);
ImageCacheManager.cache(`emoji-${emojiName}`, imageUrl, this.setImageUrl);
}
}