From 3bfcdf9c41c9a8311cb8c4b6a8a9bc5f05ce322d Mon Sep 17 00:00:00 2001 From: Eric R Date: Thu, 28 Sep 2023 06:10:22 -0400 Subject: [PATCH] [ADDED] MacOS detect --- app/utils.ts | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/app/utils.ts b/app/utils.ts index 37c17dd7..67d008b9 100644 --- a/app/utils.ts +++ b/app/utils.ts @@ -173,3 +173,15 @@ export function autoGrowTextArea(dom: HTMLTextAreaElement) { export function getCSSVar(varName: string) { return getComputedStyle(document.body).getPropertyValue(varName).trim(); } + +/** + * Detects if the Operation system is MacOS + */ +export function isMacOS(): boolean { + if (window !== 'undefined') { + let userAgent = window?.navigator?.userAgent + if (userAgent.indexOf('Mac') != -1) return true + } + + return false +}