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