fix rebase mistake

This commit is contained in:
Samuel Newman
2025-06-11 01:37:34 +03:00
parent f80d6f231b
commit 7c1a0a074b
+6 -19
View File
@@ -1,4 +1,4 @@
import React, {memo, useEffect} from 'react' import {memo, useCallback, useEffect, useMemo} from 'react'
import {StyleSheet, TouchableWithoutFeedback, View} from 'react-native' import {StyleSheet, TouchableWithoutFeedback, View} from 'react-native'
import Animated, { import Animated, {
measure, measure,
@@ -62,7 +62,7 @@ let ProfileHeaderShell = ({
const aviRef = useAnimatedRef() const aviRef = useAnimatedRef()
const onPressBack = React.useCallback(() => { const onPressBack = useCallback(() => {
if (navigation.canGoBack()) { if (navigation.canGoBack()) {
navigation.goBack() navigation.goBack()
} else { } else {
@@ -70,7 +70,7 @@ let ProfileHeaderShell = ({
} }
}, [navigation]) }, [navigation])
const _openLightbox = React.useCallback( const _openLightbox = useCallback(
(uri: string, thumbRect: MeasuredDimensions | null) => { (uri: string, thumbRect: MeasuredDimensions | null) => {
openLightbox({ openLightbox({
images: [ images: [
@@ -93,19 +93,7 @@ let ProfileHeaderShell = ({
[openLightbox], [openLightbox],
) )
const onPressAvi = React.useCallback(() => { const isMe = useMemo(
const modui = moderation.ui('avatar')
const avatar = profile.avatar
if (avatar && !(modui.blur && modui.noOverride)) {
runOnUI(() => {
'worklet'
const rect = measure(aviRef)
runOnJS(_openLightbox)(avatar, rect)
})()
}
}, [profile, moderation, _openLightbox, aviRef])
const isMe = React.useMemo(
() => currentAccount?.did === profile.did, () => currentAccount?.did === profile.did,
[currentAccount, profile], [currentAccount, profile],
) )
@@ -122,7 +110,7 @@ let ProfileHeaderShell = ({
} }
}, [live.isActive, profile.did]) }, [live.isActive, profile.did])
const onPressAvi = React.useCallback(() => { const onPressAvi = useCallback(() => {
if (live.isActive) { if (live.isActive) {
playHaptic('Light') playHaptic('Light')
logger.metric( logger.metric(
@@ -135,10 +123,9 @@ let ProfileHeaderShell = ({
const modui = moderation.ui('avatar') const modui = moderation.ui('avatar')
const avatar = profile.avatar const avatar = profile.avatar
if (avatar && !(modui.blur && modui.noOverride)) { if (avatar && !(modui.blur && modui.noOverride)) {
const aviHandle = aviRef.current
runOnUI(() => { runOnUI(() => {
'worklet' 'worklet'
const rect = measureHandle(aviHandle) const rect = measure(aviRef)
runOnJS(_openLightbox)(avatar, rect) runOnJS(_openLightbox)(avatar, rect)
})() })()
} }