Attempt to fix Facebook's browser file picker
This commit is contained in:
parent
7b53cf48ec
commit
4efb8ebc33
1 changed files with 9 additions and 1 deletions
|
@ -10,6 +10,14 @@ import { library } from '@fortawesome/fontawesome-svg-core'
|
||||||
import { FontAwesomeIcon } from '@fortawesome/react-fontawesome'
|
import { FontAwesomeIcon } from '@fortawesome/react-fontawesome'
|
||||||
import { faEdit } from '@fortawesome/free-solid-svg-icons';
|
import { faEdit } from '@fortawesome/free-solid-svg-icons';
|
||||||
|
|
||||||
|
const isFacebook = (() => {
|
||||||
|
if(typeof window === 'undefined') {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
const ua = window.navigator.userAgent || window.navigator.vendor || window.window.opera;
|
||||||
|
return ua.indexOf('FBAN') !== -1 || ua.indexOf('FBAV') !== -1;
|
||||||
|
})();
|
||||||
|
|
||||||
class Dropzone extends React.Component {
|
class Dropzone extends React.Component {
|
||||||
constructor (props) {
|
constructor (props) {
|
||||||
super(props);
|
super(props);
|
||||||
|
@ -197,7 +205,7 @@ class Dropzone extends React.Component {
|
||||||
type='file'
|
type='file'
|
||||||
id='file_input'
|
id='file_input'
|
||||||
name='file_input'
|
name='file_input'
|
||||||
accept='video/*,image/*'
|
{...(isFacebook ? {} : { accept: 'video/*,image/*' })}
|
||||||
onChange={this.handleFileInput}
|
onChange={this.handleFileInput}
|
||||||
encType='multipart/form-data'
|
encType='multipart/form-data'
|
||||||
/>
|
/>
|
||||||
|
|
Loading…
Reference in a new issue