From 9673cb943821533a092cf48bd8496444302557c3 Mon Sep 17 00:00:00 2001 From: Isacco Date: Tue, 12 Sep 2023 11:20:09 +0200 Subject: [PATCH] fix: added Mobile DuckDuckGo to ios group --- packages/beacon-ui/src/utils/platform.ts | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/packages/beacon-ui/src/utils/platform.ts b/packages/beacon-ui/src/utils/platform.ts index 16a10a37c..1e9ca66ff 100644 --- a/packages/beacon-ui/src/utils/platform.ts +++ b/packages/beacon-ui/src/utils/platform.ts @@ -33,9 +33,11 @@ const isIpad = (win: Window): boolean => { return false } -export const isIOS = (win: Window): boolean => testUserAgent(win, /iPhone|iPod/i) || isIpad(win) +export const isPrivacyBrowser = (win: Window): boolean => testUserAgent(win, /Mobile DuckDuckGo/i) -export const isAndroid = (win: Window): boolean => testUserAgent(win, /android|sink/i) +export const isIOS = (win: Window): boolean => isPrivacyBrowser(win) || testUserAgent(win, /iPhone|iPod|Mobile DuckDuckGo/i) || isIpad(win) + +export const isAndroid = (win: Window): boolean => !isPrivacyBrowser(win) && testUserAgent(win, /android|sink/i) export const isTwBrowser = (win: Window): boolean => win && (win as any).ethereum?.isTrust == true