Browse Source

Merge branch 'master' of https://github.com/blackle/mastodon into blackle-master

closed-social-v3
Eugen Rochko 7 years ago
parent
commit
def1f8c5b3
2 changed files with 4 additions and 2 deletions
  1. +3
    -2
      app/assets/javascripts/components/features/compose/components/upload_button.jsx
  2. +1
    -0
      app/assets/javascripts/components/features/compose/containers/upload_button_container.jsx

+ 3
- 2
app/assets/javascripts/components/features/compose/components/upload_button.jsx View File

@ -11,7 +11,8 @@ const UploadButton = React.createClass({
propTypes: {
disabled: React.PropTypes.bool,
onSelectFile: React.PropTypes.func.isRequired,
style: React.PropTypes.object
style: React.PropTypes.object,
key: React.PropTypes.number
},
mixins: [PureRenderMixin],
@ -36,7 +37,7 @@ const UploadButton = React.createClass({
return (
<div style={this.props.style}>
<IconButton icon='photo' title={intl.formatMessage(messages.upload)} disabled={this.props.disabled} onClick={this.handleClick} size={24} />
<input ref={this.setRef} type='file' multiple={false} onChange={this.handleChange} disabled={this.props.disabled} style={{ display: 'none' }} />
<input key={this.props.key} ref={this.setRef} type='file' multiple={false} onChange={this.handleChange} disabled={this.props.disabled} style={{ display: 'none' }} />
</div>
);
}

+ 1
- 0
app/assets/javascripts/components/features/compose/containers/upload_button_container.jsx View File

@ -4,6 +4,7 @@ import { uploadCompose } from '../../../actions/compose';
const mapStateToProps = state => ({
disabled: state.getIn(['compose', 'is_uploading']) || (state.getIn(['compose', 'media_attachments']).size > 3 || state.getIn(['compose', 'media_attachments']).some(m => m.get('type') === 'video')),
key: Math.floor((Math.random() * 0x10000))
});
const mapDispatchToProps = dispatch => ({

Loading…
Cancel
Save