Skip to content

Commit

Permalink
fix: make platform detection more robust and future proof (#435)
Browse files Browse the repository at this point in the history
  • Loading branch information
SamMousa committed May 17, 2024
1 parent 7597332 commit 776ff70
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/lib/utils/navigatorUtils.ts
Original file line number Diff line number Diff line change
@@ -1,2 +1,4 @@
export const IS_MAC =
typeof navigator !== 'undefined' ? navigator.platform.toUpperCase().indexOf('MAC') >= 0 : false
navigator?.platform?.toUpperCase().includes('MAC') ??
navigator?.userAgentData?.platform?.toUpperCase().includes('MAC') ??
false

0 comments on commit 776ff70

Please sign in to comment.