Skip to content

Commit 776ff70

Browse files
authored
fix: make platform detection more robust and future proof (#435)
1 parent 7597332 commit 776ff70

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

src/lib/utils/navigatorUtils.ts

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,4 @@
11
export const IS_MAC =
2-
typeof navigator !== 'undefined' ? navigator.platform.toUpperCase().indexOf('MAC') >= 0 : false
2+
navigator?.platform?.toUpperCase().includes('MAC') ??
3+
navigator?.userAgentData?.platform?.toUpperCase().includes('MAC') ??
4+
false

0 commit comments

Comments
 (0)