Spaces:
Runtime error
Runtime error
Update src/lib/sb-file-uploader-hoc.jsx
Browse files
src/lib/sb-file-uploader-hoc.jsx
CHANGED
@@ -6,6 +6,7 @@ import {connect} from 'react-redux';
|
|
6 |
import log from '../lib/log';
|
7 |
import sharedMessages from './shared-messages';
|
8 |
import FileSystemAPI from './tw-filesystem-api';
|
|
|
9 |
import {setFileHandle} from '../reducers/tw';
|
10 |
import JSZip from 'jszip';
|
11 |
|
@@ -107,7 +108,12 @@ const SBFileUploaderHOC = function (WrappedComponent) {
|
|
107 |
} else {
|
108 |
// create <input> element and add it to DOM
|
109 |
this.inputElement = document.createElement('input');
|
110 |
-
|
|
|
|
|
|
|
|
|
|
|
111 |
this.inputElement.style = 'display: none;';
|
112 |
this.inputElement.type = 'file';
|
113 |
this.inputElement.onchange = this.handleChange; // connects to step 3
|
|
|
6 |
import log from '../lib/log';
|
7 |
import sharedMessages from './shared-messages';
|
8 |
import FileSystemAPI from './tw-filesystem-api';
|
9 |
+
import {isMobile} from './pm-mobile';
|
10 |
import {setFileHandle} from '../reducers/tw';
|
11 |
import JSZip from 'jszip';
|
12 |
|
|
|
108 |
} else {
|
109 |
// create <input> element and add it to DOM
|
110 |
this.inputElement = document.createElement('input');
|
111 |
+
|
112 |
+
// pm: Some bad mobile devices block any file type (iOS)
|
113 |
+
if (!isMobile()) {
|
114 |
+
this.inputElement.accept = '.sb,.sb2,.sb3,.pm,.pmp';
|
115 |
+
}
|
116 |
+
|
117 |
this.inputElement.style = 'display: none;';
|
118 |
this.inputElement.type = 'file';
|
119 |
this.inputElement.onchange = this.handleChange; // connects to step 3
|