Merge pull request #594 from matrix-org/luke/fix-scroll-jump-on-video-decryption

Fix scroll jumping when a video is decrypted
pull/21833/head
Richard van der Hoff 2016-12-20 12:41:39 +00:00 committed by GitHub
commit a014dcc2d0
1 changed files with 9 additions and 0 deletions

View File

@ -27,6 +27,14 @@ import q from 'q';
module.exports = React.createClass({ module.exports = React.createClass({
displayName: 'MVideoBody', displayName: 'MVideoBody',
propTypes: {
/* the MatrixEvent to show */
mxEvent: React.PropTypes.object.isRequired,
/* called when the video has loaded */
onWidgetLoad: React.PropTypes.func.isRequired,
},
getInitialState: function() { getInitialState: function() {
return { return {
decryptedUrl: null, decryptedUrl: null,
@ -100,6 +108,7 @@ module.exports = React.createClass({
decryptedThumbnailUrl: thumbnailUrl, decryptedThumbnailUrl: thumbnailUrl,
decryptedBlob: decryptedBlob, decryptedBlob: decryptedBlob,
}); });
this.props.onWidgetLoad();
}); });
}).catch((err) => { }).catch((err) => {
console.warn("Unable to decrypt attachment: ", err) console.warn("Unable to decrypt attachment: ", err)