Move browser env into main env (#9718)
This commit is contained in:
@@ -1,5 +0,0 @@
|
||||
export const isSafari = false
|
||||
export const isFirefox = false
|
||||
export const isTouchDevice = true
|
||||
export const IS_ANDROIDWeb = false
|
||||
export const isHighDPI = true
|
||||
@@ -1,9 +0,0 @@
|
||||
// https://stackoverflow.com/questions/7944460/detect-safari-browser
|
||||
export const isSafari = /^((?!chrome|android).)*safari/i.test(
|
||||
navigator.userAgent,
|
||||
)
|
||||
export const isFirefox = /firefox|fxios/i.test(navigator.userAgent)
|
||||
export const isTouchDevice = window.matchMedia('(pointer: coarse)').matches
|
||||
export const IS_ANDROIDWeb =
|
||||
/android/i.test(navigator.userAgent) && isTouchDevice
|
||||
export const isHighDPI = window.matchMedia('(min-resolution: 2dppx)').matches
|
||||
@@ -12,10 +12,9 @@ import Animated, {
|
||||
withTiming,
|
||||
} from 'react-native-reanimated'
|
||||
|
||||
import {isTouchDevice} from '#/lib/browser'
|
||||
import {IS_NATIVE} from '#/env'
|
||||
import {IS_NATIVE, IS_WEB_TOUCH_DEVICE} from '#/env'
|
||||
|
||||
const DEFAULT_TARGET_SCALE = IS_NATIVE || isTouchDevice ? 0.98 : 1
|
||||
const DEFAULT_TARGET_SCALE = IS_NATIVE || IS_WEB_TOUCH_DEVICE ? 0.98 : 1
|
||||
|
||||
const AnimatedPressable = Animated.createAnimatedComponent(Pressable)
|
||||
|
||||
|
||||
@@ -1,7 +1,6 @@
|
||||
import {Dimensions} from 'react-native'
|
||||
|
||||
import {isSafari} from '#/lib/browser'
|
||||
import {IS_WEB} from '#/env'
|
||||
import {IS_WEB, IS_WEB_SAFARI} from '#/env'
|
||||
|
||||
const {height: SCREEN_HEIGHT} = Dimensions.get('window')
|
||||
|
||||
@@ -560,7 +559,7 @@ export function parseTenorGif(urlp: URL):
|
||||
}
|
||||
|
||||
if (IS_WEB) {
|
||||
if (isSafari) {
|
||||
if (IS_WEB_SAFARI) {
|
||||
id = id.replace('AAAAC', 'AAAP1')
|
||||
filename = filename.replace('.gif', '.mp4')
|
||||
} else {
|
||||
|
||||
Reference in New Issue
Block a user