Skip to content

Commit 60dea66

Browse files
authored
fix(shared): add optional chain to isInElectron env (#629)
1 parent eb5d3e8 commit 60dea66

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

packages/shared/src/env.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ export const target = (typeof window !== 'undefined'
1111

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

0 commit comments

Comments
 (0)