From 5c4ce729f794ab392023e39659b71f73ef16d12d Mon Sep 17 00:00:00 2001 From: Faisal Amir Date: Mon, 22 Sep 2025 20:32:09 +0700 Subject: [PATCH] chore: update checking platform using config isntead navigation agent --- web-app/src/lib/platform/utils.ts | 11 ++++------- 1 file changed, 4 insertions(+), 7 deletions(-) diff --git a/web-app/src/lib/platform/utils.ts b/web-app/src/lib/platform/utils.ts index cc905802a..ff083acf6 100644 --- a/web-app/src/lib/platform/utils.ts +++ b/web-app/src/lib/platform/utils.ts @@ -1,7 +1,8 @@ -/* eslint-disable @typescript-eslint/no-explicit-any */ import { Platform, PlatformFeature } from './types' declare const IS_WEB_APP: boolean +declare const IS_IOS: boolean +declare const IS_ANDROID: boolean export const isPlatformTauri = (): boolean => { if (typeof IS_WEB_APP === 'undefined') { @@ -14,15 +15,11 @@ export const isPlatformTauri = (): boolean => { } export const isPlatformIOS = (): boolean => { - if (typeof navigator === 'undefined') return false - return ( - /iPad|iPhone|iPod/.test(navigator.userAgent) && !(window as any).MSStream - ) + return IS_IOS } export const isPlatformAndroid = (): boolean => { - if (typeof navigator === 'undefined') return false - return /Android/.test(navigator.userAgent) + return IS_ANDROID } export const isIOS = (): boolean => isPlatformIOS()