diff --git a/src/components/views/messages/MFileBody.js b/src/components/views/messages/MFileBody.js index 781d340252..7960db0384 100644 --- a/src/components/views/messages/MFileBody.js +++ b/src/components/views/messages/MFileBody.js @@ -203,6 +203,17 @@ module.exports = React.createClass({ }; }, + propTypes: { + /* the MatrixEvent to show */ + mxEvent: PropTypes.object.isRequired, + /* already decrypted blob */ + decryptedBlob: PropTypes.object, + /* called when the download link iframe is shown */ + onHeightChanged: PropTypes.func, + /* the shape of the tile, used */ + tileShape: PropTypes.string, + }, + contextTypes: { appConfig: PropTypes.object, }, @@ -248,6 +259,12 @@ module.exports = React.createClass({ this.tint(); }, + componentDidUpdate: function(prevProps, prevState) { + if (this.props.onHeightChanged && !prevState.decryptedBlob && this.state.decryptedBlob) { + this.props.onHeightChanged(); + } + }, + componentWillUnmount: function() { // Remove this from the list of mounted components delete mounts[this.id];