From f1ca03e3788d89295f889eb67da270adbee6137f Mon Sep 17 00:00:00 2001 From: EricGit Date: Thu, 28 Sep 2023 13:21:17 -0400 Subject: [PATCH] [FIXED] now it should detects all macintosh --- app/utils.ts | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/app/utils.ts b/app/utils.ts index 3db8e7c4..1b76285c 100644 --- a/app/utils.ts +++ b/app/utils.ts @@ -175,13 +175,13 @@ export function getCSSVar(varName: string) { } /** - * Detects if the Operation system is MacOS + * Detects Macintosh */ export function isMacOS(): boolean { if (typeof window !== "undefined") { - let userAgent = window?.navigator?.userAgent; - if (userAgent.indexOf("Mac") != -1) return true; + let userAgent = window.navigator.userAgent.toLocaleLowerCase(); + const macintosh = /iphone|ipad|ipod|macintosh/.test(userAgent) + return !!macintosh } - - return false; + return false }