refactor(web): dependency management (#2386)
This commit is contained in:
20
packages/ui-services/src/Utils/Utils.ts
Normal file
20
packages/ui-services/src/Utils/Utils.ts
Normal file
@@ -0,0 +1,20 @@
|
||||
import { Platform } from '@standardnotes/models'
|
||||
|
||||
declare global {
|
||||
interface Document {
|
||||
documentMode?: string
|
||||
}
|
||||
|
||||
interface Window {
|
||||
MSStream?: unknown
|
||||
platform?: Platform
|
||||
}
|
||||
}
|
||||
|
||||
// https://stackoverflow.com/questions/9038625/detect-if-device-is-ios/9039885#9039885
|
||||
export const isIOS = () =>
|
||||
(/iPad|iPhone|iPod/.test(navigator.userAgent) && !window.MSStream) ||
|
||||
(navigator.userAgent.includes('Mac') && 'ontouchend' in document && navigator.maxTouchPoints > 1) ||
|
||||
window.platform === Platform.Ios
|
||||
|
||||
export const isAndroid = () => navigator.userAgent.toLowerCase().includes('android')
|
||||
Reference in New Issue
Block a user