Skip to content

Commit bc611ce

Browse files
committed
Disable show[Save|Open]FilePicker on Android
Latest Chrome completely broke showSaveFilePicker. This has caused so many bugs in the past. Let's just not use it on broken platforms.
1 parent 7f20bc5 commit bc611ce

File tree

2 files changed

+6
-2
lines changed

2 files changed

+6
-2
lines changed

src/containers/sb3-downloader.jsx

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -295,7 +295,9 @@ SB3Downloader.propTypes = {
295295
};
296296
SB3Downloader.defaultProps = {
297297
className: '',
298-
showSaveFilePicker: typeof showSaveFilePicker === 'function' ? window.showSaveFilePicker.bind(window) : null
298+
showSaveFilePicker: typeof showSaveFilePicker === 'function' && !navigator.userAgent.includes('Android') ?
299+
window.showSaveFilePicker.bind(window) :
300+
null
299301
};
300302

301303
const mapStateToProps = state => ({

src/lib/sb-file-uploader-hoc.jsx

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -288,7 +288,9 @@ const SBFileUploaderHOC = function (WrappedComponent) {
288288
onSetFileHandle: PropTypes.func
289289
};
290290
SBFileUploaderComponent.defaultProps = {
291-
showOpenFilePicker: typeof showOpenFilePicker === 'function' ? window.showOpenFilePicker.bind(window) : null
291+
showOpenFilePicker: typeof showOpenFilePicker === 'function' && !navigator.userAgent.includes('Android') ?
292+
window.showOpenFilePicker.bind(window) :
293+
null
292294
};
293295
const mapStateToProps = (state, ownProps) => {
294296
const loadingState = state.scratchGui.projectState.loadingState;

0 commit comments

Comments
 (0)