Lookup did for my profile at screen to avoid bad actor error (#1800)
parent
8747c215b1
commit
846c130706
|
@ -349,7 +349,6 @@ function NotificationsTabNavigator() {
|
|||
|
||||
const MyProfileTabNavigator = observer(function MyProfileTabNavigatorImpl() {
|
||||
const contentStyle = useColorSchemeStyle(styles.bgLight, styles.bgDark)
|
||||
const store = useStores()
|
||||
return (
|
||||
<MyProfileTab.Navigator
|
||||
screenOptions={{
|
||||
|
@ -364,7 +363,7 @@ const MyProfileTabNavigator = observer(function MyProfileTabNavigatorImpl() {
|
|||
// @ts-ignore // TODO: fix this broken type in ProfileScreen
|
||||
getComponent={() => ProfileScreen}
|
||||
initialParams={{
|
||||
name: store.me.did,
|
||||
name: 'me',
|
||||
}}
|
||||
/>
|
||||
{commonScreens(MyProfileTab as typeof HomeTab)}
|
||||
|
|
|
@ -36,6 +36,7 @@ export const ProfileScreen = withAuthRequired(
|
|||
const store = useStores()
|
||||
const {screen, track} = useAnalytics()
|
||||
const viewSelectorRef = React.useRef<ViewSelectorHandle>(null)
|
||||
const name = route.params.name === 'me' ? store.me.did : route.params.name
|
||||
|
||||
useEffect(() => {
|
||||
screen('Profile')
|
||||
|
@ -43,8 +44,8 @@ export const ProfileScreen = withAuthRequired(
|
|||
|
||||
const [hasSetup, setHasSetup] = useState<boolean>(false)
|
||||
const uiState = React.useMemo(
|
||||
() => new ProfileUiModel(store, {user: route.params.name}),
|
||||
[route.params.name, store],
|
||||
() => new ProfileUiModel(store, {user: name}),
|
||||
[name, store],
|
||||
)
|
||||
useSetTitle(combinedDisplayName(uiState.profile))
|
||||
|
||||
|
@ -54,7 +55,7 @@ export const ProfileScreen = withAuthRequired(
|
|||
|
||||
useEffect(() => {
|
||||
setHasSetup(false)
|
||||
}, [route.params.name])
|
||||
}, [name])
|
||||
|
||||
// We don't need this to be reactive, so we can just register the listeners once
|
||||
useEffect(() => {
|
||||
|
|
Loading…
Reference in New Issue