Skip to content

Commit

Permalink
Make it safer
Browse files Browse the repository at this point in the history
  • Loading branch information
cbravobernal committed Nov 20, 2024
1 parent aa2c911 commit 460ece4
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions packages/components/src/form-file-upload/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -52,9 +52,9 @@ export function FormFileUpload( {
// This can be removed once the Chromium fix is in the stable channel.
// Prevent Safari from adding "image/heic" and "image/heif" to the accept attribute.
const isSafari =
globalThis.navigator?.userAgent.includes( 'Safari' ) &&
! globalThis.navigator?.userAgent.includes( 'Chrome' ) &&
! globalThis.navigator?.userAgent.includes( 'Chromium' );
globalThis.window?.navigator.userAgent.includes( 'Safari' ) &&
! globalThis.window?.navigator.userAgent.includes( 'Chrome' ) &&
! globalThis.window?.navigator.userAgent.includes( 'Chromium' );
const compatAccept =
! isSafari && !! accept?.includes( 'image/*' )
? `${ accept }, image/heic, image/heif`
Expand Down

0 comments on commit 460ece4

Please sign in to comment.