mirror of
https://github.com/the-djmaze/snappymail.git
synced 2026-07-13 03:27:39 +03:00
Underscore.js _.find() to native Array.find()
This commit is contained in:
parent
2404f6466d
commit
9c0072d626
19 changed files with 55 additions and 79 deletions
|
|
@ -1,5 +1,4 @@
|
|||
import window from 'window';
|
||||
import _ from '_';
|
||||
import $ from '$';
|
||||
import key from 'key';
|
||||
import ko from 'ko';
|
||||
|
|
@ -152,15 +151,7 @@ export const htmlEditorLangsMap = {
|
|||
/**
|
||||
* @type {boolean}
|
||||
*/
|
||||
let bAllowPdfPreview = !bMobileDevice;
|
||||
|
||||
if (bAllowPdfPreview && window.navigator && window.navigator.mimeTypes) {
|
||||
bAllowPdfPreview = !!_.find(window.navigator.mimeTypes, (type) => type && 'application/pdf' === type.type);
|
||||
|
||||
if (!bAllowPdfPreview) {
|
||||
bAllowPdfPreview = 'undefined' !== typeof window.navigator.mimeTypes['application/pdf'];
|
||||
}
|
||||
}
|
||||
let bAllowPdfPreview = !bMobileDevice && undefined !== window.navigator.mimeTypes['application/pdf'];
|
||||
|
||||
export { bAllowPdfPreview };
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue