Page MenuHomePhabricator

D6421.diff
No OneTemporary

D6421.diff

diff --git a/native/profile/profile-screen.react.js b/native/profile/profile-screen.react.js
--- a/native/profile/profile-screen.react.js
+++ b/native/profile/profile-screen.react.js
@@ -4,6 +4,7 @@
import { View, Text, Alert, Platform, ScrollView } from 'react-native';
import { logOutActionTypes, logOut } from 'lib/actions/user-actions';
+import { useStringForUser } from 'lib/hooks/ens-cache';
import { preRequestUserStateSelector } from 'lib/selectors/account-selectors';
import { createLoadingStatusSelector } from 'lib/selectors/loading-selectors';
import { accountHasPassword } from 'lib/shared/account-utils';
@@ -68,15 +69,10 @@
+dispatchActionPromise: DispatchActionPromise,
+logOut: (preRequestUserState: PreRequestUserState) => Promise<LogOutResult>,
+staffCanSee: boolean,
+ +stringForUser: ?string,
};
class ProfileScreen extends React.PureComponent<Props> {
- get username() {
- return this.props.currentUserInfo && !this.props.currentUserInfo.anonymous
- ? this.props.currentUserInfo.username
- : undefined;
- }
-
get loggedOutOrLoggingOut() {
return (
!this.props.currentUserInfo ||
@@ -134,7 +130,7 @@
<SingleLine
style={[this.props.styles.label, this.props.styles.username]}
>
- {this.username}
+ {this.props.stringForUser}
</SingleLine>
<Button
onPress={this.onPressLogOut}
@@ -360,6 +356,7 @@
const callLogOut = useServerCall(logOut);
const dispatchActionPromise = useDispatchActionPromise();
const staffCanSee = useStaffCanSee();
+ const stringForUser = useStringForUser(currentUserInfo);
return (
<ProfileScreen
@@ -372,6 +369,7 @@
logOut={callLogOut}
dispatchActionPromise={dispatchActionPromise}
staffCanSee={staffCanSee}
+ stringForUser={stringForUser}
/>
);
},

File Metadata

Mime Type
text/plain
Expires
Thu, Dec 19, 10:11 PM (20 h, 57 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
2679001
Default Alt Text
D6421.diff (1 KB)

Event Timeline