about summary refs log tree commit diff
path: root/app/assets
diff options
context:
space:
mode:
authorEugen Rochko <eugen@zeonfederated.com>2017-01-09 14:13:46 +0100
committerEugen Rochko <eugen@zeonfederated.com>2017-01-09 14:13:46 +0100
commit5d558c14b4de87cc45a3342f1b67ce9cc1445b2e (patch)
tree36ce2a57e7b686f19132ebb12fcd177b3df4c7c0 /app/assets
parentd6a456dc714337a696e206c31d182630a94f89cd (diff)
parentdef1f8c5b3ec4bc5bd8c8335b4919e011d2757b9 (diff)
Merge branch 'blackle-master'
Diffstat (limited to 'app/assets')
-rw-r--r--app/assets/javascripts/components/features/compose/components/upload_button.jsx5
-rw-r--r--app/assets/javascripts/components/features/compose/containers/upload_button_container.jsx1
2 files changed, 4 insertions, 2 deletions
diff --git a/app/assets/javascripts/components/features/compose/components/upload_button.jsx b/app/assets/javascripts/components/features/compose/components/upload_button.jsx
index 5250ff748..f00ef3f8f 100644
--- a/app/assets/javascripts/components/features/compose/components/upload_button.jsx
+++ b/app/assets/javascripts/components/features/compose/components/upload_button.jsx
@@ -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>
     );
   }
diff --git a/app/assets/javascripts/components/features/compose/containers/upload_button_container.jsx b/app/assets/javascripts/components/features/compose/containers/upload_button_container.jsx
index 4154b0737..7afa7d355 100644
--- a/app/assets/javascripts/components/features/compose/containers/upload_button_container.jsx
+++ b/app/assets/javascripts/components/features/compose/containers/upload_button_container.jsx
@@ -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 => ({