Skip to content
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 13 additions & 1 deletion packages/scratch-gui/src/lib/sb-file-uploader-hoc.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,12 @@ const messages = defineMessages({
id: 'gui.projectLoader.loadError',
defaultMessage: 'The project file that was selected failed to load.',
description: 'An error that displays when a local project file fails to load.'
},
faceSensingError: {
id: 'gui.projectLoader.faceSensingError',
defaultMessage: 'This project uses features (Face Sensing) that are not supported in your current version' +
' of the Scratch editor. Try updating to latest editor version or opening it in Scratch Lab.',
description: 'An error that displays when a local project file fails to load because it has face sensing.'
}
});

Expand Down Expand Up @@ -159,7 +165,13 @@ const SBFileUploaderHOC = function (WrappedComponent) {
})
.catch(error => {
log.warn(error);
alert(this.props.intl.formatMessage(messages.loadError)); // eslint-disable-line no-alert
if (error.message.includes('faceSensing')) {
alert( // eslint-disable-line no-alert
this.props.intl.formatMessage(messages.faceSensingError)
);
} else {
alert(this.props.intl.formatMessage(messages.loadError)); // eslint-disable-line no-alert
}
})
.then(() => {
this.props.onLoadingFinished(this.props.loadingState, loadingSuccess);
Expand Down