chore: update checking platform using config isntead navigation agent
This commit is contained in:
parent
e3c29277f3
commit
5c4ce729f7
@ -1,7 +1,8 @@
|
|||||||
/* eslint-disable @typescript-eslint/no-explicit-any */
|
|
||||||
import { Platform, PlatformFeature } from './types'
|
import { Platform, PlatformFeature } from './types'
|
||||||
|
|
||||||
declare const IS_WEB_APP: boolean
|
declare const IS_WEB_APP: boolean
|
||||||
|
declare const IS_IOS: boolean
|
||||||
|
declare const IS_ANDROID: boolean
|
||||||
|
|
||||||
export const isPlatformTauri = (): boolean => {
|
export const isPlatformTauri = (): boolean => {
|
||||||
if (typeof IS_WEB_APP === 'undefined') {
|
if (typeof IS_WEB_APP === 'undefined') {
|
||||||
@ -14,15 +15,11 @@ export const isPlatformTauri = (): boolean => {
|
|||||||
}
|
}
|
||||||
|
|
||||||
export const isPlatformIOS = (): boolean => {
|
export const isPlatformIOS = (): boolean => {
|
||||||
if (typeof navigator === 'undefined') return false
|
return IS_IOS
|
||||||
return (
|
|
||||||
/iPad|iPhone|iPod/.test(navigator.userAgent) && !(window as any).MSStream
|
|
||||||
)
|
|
||||||
}
|
}
|
||||||
|
|
||||||
export const isPlatformAndroid = (): boolean => {
|
export const isPlatformAndroid = (): boolean => {
|
||||||
if (typeof navigator === 'undefined') return false
|
return IS_ANDROID
|
||||||
return /Android/.test(navigator.userAgent)
|
|
||||||
}
|
}
|
||||||
|
|
||||||
export const isIOS = (): boolean => isPlatformIOS()
|
export const isIOS = (): boolean => isPlatformIOS()
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user