upgrade, remove timeout
This commit is contained in:
@@ -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')) {
|
||||
|
||||
@@ -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})
|
||||
|
||||
Reference in New Issue
Block a user