Fix MIME check for JPEG in lightbox copy handler (#4643)

* Fix MIME check for JPEG in lightbox copy handler

* Handle both image/jpeg and non-standard image/jpg
This commit is contained in:
Vin Howe 2020-11-23 12:41:52 -07:00 committed by Josh Perez
parent 24b70e6edd
commit e398520db0
1 changed files with 5 additions and 1 deletions

View File

@ -425,7 +425,11 @@ export class Lightbox extends React.Component<Props, State> {
const { contentType } = this.props;
// These are the only image types supported by Electron's NativeImage
if (event && contentType !== 'image/png' && contentType !== 'image/jpg') {
if (
event &&
contentType !== 'image/png' &&
!contentType?.match(/image\/jpe?g/g)
) {
event.preventDefault();
}
};