upgrade, remove timeout

This commit is contained in:
Hailey
2025-05-05 09:17:58 -07:00
parent 29863ca89d
commit f481c7bfdf
4 changed files with 20 additions and 27 deletions
+1 -1
View File
@@ -142,7 +142,7 @@
"expo-font": "~13.3.0",
"expo-haptics": "~14.1.4",
"expo-image": "~2.1.6",
"expo-image-crop-tool": "^0.1.4",
"expo-image-crop-tool": "^0.1.5",
"expo-image-manipulator": "~13.1.5",
"expo-image-picker": "~16.1.4",
"expo-linear-gradient": "~14.1.4",
+7 -12
View File
@@ -22,7 +22,7 @@ import {
import {makeProfileLink} from '#/lib/routes/links'
import {colors} from '#/lib/styles'
import {logger} from '#/logger'
import {isAndroid, isIOS, isNative, isWeb} from '#/platform/detection'
import {isAndroid, isNative, isWeb} from '#/platform/detection'
import {precacheProfile} from '#/state/queries/profile'
import {HighPriorityImage} from '#/view/com/util/images/Image'
import {tokens, useTheme} from '#/alf'
@@ -337,17 +337,12 @@ let EditableUserAvatar = ({
}
try {
setTimeout(
async () => {
const croppedImage = await openCropper({
imageUri: item.path,
shape: 'circle',
aspectRatio: 1,
})
onSelectNewAvatar(croppedImage)
},
isIOS ? 500 : 500,
)
const croppedImage = await openCropper({
imageUri: item.path,
shape: 'circle',
aspectRatio: 1,
})
onSelectNewAvatar(croppedImage)
} catch (e: any) {
// Don't log errors for cancelling selection to sentry on ios or android
if (!String(e).toLowerCase().includes('cancel')) {
+8 -10
View File
@@ -1,7 +1,7 @@
import React from 'react'
import {Pressable, StyleSheet, View} from 'react-native'
import {Image} from 'expo-image'
import {ModerationUI} from '@atproto/api'
import {type ModerationUI} from '@atproto/api'
import {msg, Trans} from '@lingui/macro'
import {useLingui} from '@lingui/react'
@@ -28,7 +28,7 @@ import {
openCamera,
openCropper,
openPicker,
RNImage,
type RNImage,
} from '../../../lib/media/picker'
export function UserBanner({
@@ -71,14 +71,12 @@ export function UserBanner({
}
try {
setTimeout(async () => {
onSelectNewBanner?.(
await openCropper({
imageUri: items[0].path,
aspectRatio: 3 / 1,
}),
)
}, 750)
onSelectNewBanner?.(
await openCropper({
imageUri: items[0].path,
aspectRatio: 3 / 1,
}),
)
} catch (e: any) {
if (!String(e).includes('Canceled')) {
logger.error('Failed to crop banner', {error: e})
+4 -4
View File
@@ -11247,10 +11247,10 @@ expo-haptics@~14.1.4:
resolved "https://registry.yarnpkg.com/expo-haptics/-/expo-haptics-14.1.4.tgz#442f48b1bdf83484d4fcadc653445aaae6049b70"
integrity sha512-QZdE3NMX74rTuIl82I+n12XGwpDWKb8zfs5EpwsnGi/D/n7O2Jd4tO5ivH+muEG/OCJOMq5aeaVDqqaQOhTkcA==
expo-image-crop-tool@^0.1.4:
version "0.1.4"
resolved "https://registry.yarnpkg.com/expo-image-crop-tool/-/expo-image-crop-tool-0.1.4.tgz#bced84f0b1184071cd46a72d32271ab35399b9ec"
integrity sha512-ow24RdFlJ0zQx1FLLXJuDQtU6gsJUtFCwcwKqdQGH3N7x7B1h6czmXstB5eIiYbqWwTIIChiPkKYC16FltW1Ug==
expo-image-crop-tool@^0.1.5:
version "0.1.5"
resolved "https://registry.yarnpkg.com/expo-image-crop-tool/-/expo-image-crop-tool-0.1.5.tgz#4c56e10f9176c5d0822259b63776722e17ba0fbf"
integrity sha512-61Kh3MWAbScAK2bb+ddnVKTC/lisPDB9JqGIlNI/njTYW+dWW9sUa1jAmb/5nHQbZcHyFm/J3XCTjR2dkHf0QA==
expo-image-loader@~5.1.0:
version "5.1.0"