From c92ee08367be21a4c71b223a762685e451f13d00 Mon Sep 17 00:00:00 2001 From: Paul Wackerow <54227730+wackerow@users.noreply.github.com> Date: Thu, 15 Dec 2022 14:46:06 -0800 Subject: [PATCH] debug using only re.test(string) --- src/components/UI/downloads/DownloadsTable.tsx | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/src/components/UI/downloads/DownloadsTable.tsx b/src/components/UI/downloads/DownloadsTable.tsx index 4e95b11a57..ce9523a3ee 100644 --- a/src/components/UI/downloads/DownloadsTable.tsx +++ b/src/components/UI/downloads/DownloadsTable.tsx @@ -39,11 +39,10 @@ export const DownloadsTable: FC = ({ const getDefaultIndex = useMemo(() => { const OS: string = typeof window !== 'undefined' ? window.navigator.platform : ''; - const userAgent = typeof window !== 'undefined' ? window.navigator.userAgent : ''; - if (OS.includes('Mac')) return 1; - if (OS.includes('Win')) return 2; - if (OS.includes('iPhone')) return 3; - if (/Android/i.test(OS) || /Android|SamsungBrowser/i.test(userAgent)) return 4; + if (/Mac/i.test(OS)) return 1; + if (/Win/i.test(OS)) return 2; + if (/iPhone/i.test(OS)) return 3; + if (/Android/i.test(OS)) return 4; return 0; }, [])