Skip to content

Commit

Permalink
fix(shared): add optional chain to isInElectron env (#629)
Browse files Browse the repository at this point in the history
  • Loading branch information
danielj247 authored Oct 10, 2024
1 parent eb5d3e8 commit 60dea66
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion packages/shared/src/env.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ export const target = (typeof window !== 'undefined'

export const isInChromePanel = typeof target.chrome !== 'undefined' && !!target.chrome.devtools
export const isInIframe = isBrowser && target.self !== target.top
export const isInElectron = typeof navigator !== 'undefined' && navigator.userAgent.toLowerCase().includes('electron')
export const isInElectron = typeof navigator !== 'undefined' && navigator.userAgent?.toLowerCase().includes('electron')
// @ts-expect-error skip type check
export const isNuxtApp = typeof window !== 'undefined' && !!window.__NUXT__
export const isInSeparateWindow = !isInIframe && !isInChromePanel && !isInElectron

0 comments on commit 60dea66

Please sign in to comment.