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:
parent
24b70e6edd
commit
e398520db0
1 changed files with 5 additions and 1 deletions
|
@ -425,7 +425,11 @@ export class Lightbox extends React.Component<Props, State> {
|
||||||
const { contentType } = this.props;
|
const { contentType } = this.props;
|
||||||
|
|
||||||
// These are the only image types supported by Electron's NativeImage
|
// 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();
|
event.preventDefault();
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue