debug using only re.test(string)
This commit is contained in:
parent
7100b079b9
commit
c92ee08367
|
@ -39,11 +39,10 @@ export const DownloadsTable: FC<Props> = ({
|
||||||
|
|
||||||
const getDefaultIndex = useMemo<number>(() => {
|
const getDefaultIndex = useMemo<number>(() => {
|
||||||
const OS: string = typeof window !== 'undefined' ? window.navigator.platform : '';
|
const OS: string = typeof window !== 'undefined' ? window.navigator.platform : '';
|
||||||
const userAgent = typeof window !== 'undefined' ? window.navigator.userAgent : '';
|
if (/Mac/i.test(OS)) return 1;
|
||||||
if (OS.includes('Mac')) return 1;
|
if (/Win/i.test(OS)) return 2;
|
||||||
if (OS.includes('Win')) return 2;
|
if (/iPhone/i.test(OS)) return 3;
|
||||||
if (OS.includes('iPhone')) return 3;
|
if (/Android/i.test(OS)) return 4;
|
||||||
if (/Android/i.test(OS) || /Android|SamsungBrowser/i.test(userAgent)) return 4;
|
|
||||||
return 0;
|
return 0;
|
||||||
}, [])
|
}, [])
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue