Staging #1066

Merged
jessopb merged 55 commits from staging into release 2020-05-16 17:08:51 +02:00
Showing only changes of commit 62cf5aefed - Show all commits

View file

@ -11,11 +11,10 @@ import { FontAwesomeIcon } from '@fortawesome/react-fontawesome'
import { faEdit } from '@fortawesome/free-solid-svg-icons'; import { faEdit } from '@fortawesome/free-solid-svg-icons';
const isFacebook = (() => { const isFacebook = (() => {
if(typeof window === 'undefined') { if(typeof window === 'undefined' || typeof window.navigator.userAgent === 'undefined') {
return false; return false;
} }
const ua = window.navigator.userAgent || window.navigator.vendor || window.window.opera; return window.navigator.userAgent.indexOf('FBAN') !== -1 || window.navigator.userAgent.indexOf('FBAV') !== -1;
return ua.indexOf('FBAN') !== -1 || ua.indexOf('FBAV') !== -1;
})(); })();
class Dropzone extends React.Component { class Dropzone extends React.Component {
@ -205,7 +204,7 @@ class Dropzone extends React.Component {
type='file' type='file'
id='file_input' id='file_input'
name='file_input' name='file_input'
{...(isFacebook ? {} : { accept: 'video/*,image/*' })} {...(isFacebook ? { accept: 'image/*' } : { accept: 'video/*,image/*' })}
onChange={this.handleFileInput} onChange={this.handleFileInput}
encType='multipart/form-data' encType='multipart/form-data'
/> />