mirror of
https://github.com/vector-im/element-web.git
synced 2024-11-16 21:24:59 +08:00
Pass the decryptedUrl to the MFileBody so that it doesn't need to decrypt it itself.
This commit is contained in:
parent
1529396ef5
commit
4214c67f8f
@ -81,7 +81,7 @@ export default class MAudioBody extends React.Component {
|
||||
return (
|
||||
<span className="mx_MAudioBody">
|
||||
<audio src={contentUrl} controls />
|
||||
<MFileBody {...this.props} />
|
||||
<MFileBody {...this.props} decryptedUrl={this.state.decryptedUrl} />
|
||||
</span>
|
||||
);
|
||||
}
|
||||
|
@ -28,7 +28,7 @@ module.exports = React.createClass({
|
||||
|
||||
getInitialState: function() {
|
||||
return {
|
||||
decryptedUrl: null,
|
||||
decryptedUrl: (this.props.decryptedUrl ? this.props.decryptedUrl : null),
|
||||
};
|
||||
},
|
||||
|
||||
|
@ -19,7 +19,8 @@ limitations under the License.
|
||||
var React = require('react');
|
||||
var filesize = require('filesize');
|
||||
|
||||
var MFileBody = require('./MFileBody');
|
||||
import MFileBody from './MFileBody';
|
||||
|
||||
var MatrixClientPeg = require('../../../MatrixClientPeg');
|
||||
var ImageUtils = require('../../../ImageUtils');
|
||||
var Modal = require('../../../Modal');
|
||||
@ -184,7 +185,7 @@ module.exports = React.createClass({
|
||||
onMouseEnter={this.onImageEnter}
|
||||
onMouseLeave={this.onImageLeave} />
|
||||
</a>
|
||||
<MFileBody {...this.props} />
|
||||
<MFileBody {...this.props} decryptedUrl={this.state.decryptedUrl} />
|
||||
</span>
|
||||
);
|
||||
} else if (content.body) {
|
||||
|
@ -147,7 +147,7 @@ module.exports = React.createClass({
|
||||
controls preload={preload} autoPlay={false}
|
||||
height={height} width={width} poster={poster}>
|
||||
</video>
|
||||
<MFileBody {...this.props} />
|
||||
<MFileBody {...this.props} decryptedUrl={this.state.decryptedUrl} />
|
||||
</span>
|
||||
);
|
||||
},
|
||||
|
Loading…
Reference in New Issue
Block a user