Page Menu
Home
Phabricator
Search
Configure Global Search
Log In
Files
F3513952
D6470.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Award Token
Flag For Later
Size
2 KB
Referenced Files
None
Subscribers
None
D6470.diff
View Options
diff --git a/web/settings/password-change-modal.js b/web/settings/password-change-modal.js
--- a/web/settings/password-change-modal.js
+++ b/web/settings/password-change-modal.js
@@ -8,11 +8,9 @@
changeUserPassword,
} from 'lib/actions/user-actions';
import { useModalContext } from 'lib/components/modal-provider.react';
+import { useStringForUser } from 'lib/hooks/ens-cache';
import { createLoadingStatusSelector } from 'lib/selectors/loading-selectors';
-import {
- type PasswordUpdate,
- type CurrentUserInfo,
-} from 'lib/types/user-types';
+import { type PasswordUpdate } from 'lib/types/user-types';
import {
type DispatchActionPromise,
useDispatchActionPromise,
@@ -26,11 +24,11 @@
import css from './password-change-modal.css';
type Props = {
- +currentUserInfo: ?CurrentUserInfo,
+inputDisabled: boolean,
+dispatchActionPromise: DispatchActionPromise,
+changeUserPassword: (passwordUpdate: PasswordUpdate) => Promise<void>,
+popModal: () => void,
+ +stringForUser: ?string,
};
type State = {
+newPassword: string,
@@ -58,12 +56,6 @@
this.newPasswordInput.focus();
}
- get username() {
- return this.props.currentUserInfo && !this.props.currentUserInfo.anonymous
- ? this.props.currentUserInfo.username
- : undefined;
- }
-
render() {
let errorMsg;
if (this.state.errorMessage) {
@@ -80,7 +72,9 @@
<div className={css['form-content']}>
<p className={css['username-container']}>
<span className={css['username-label']}>{'Logged in as '}</span>
- <span className={css['username']}>{this.username}</span>
+ <span className={css['username']}>
+ {this.props.stringForUser}
+ </span>
</p>
<div className={css['form-content']}>
<Input
@@ -242,7 +236,6 @@
);
const ConnectedPasswordChangeModal: React.ComponentType<{}> = React.memo<{}>(
function ConnectedPasswordChangeModal(): React.Node {
- const currentUserInfo = useSelector(state => state.currentUserInfo);
const inputDisabled = useSelector(
state => changeUserPasswordLoadingStatusSelector(state) === 'loading',
);
@@ -251,13 +244,16 @@
const modalContext = useModalContext();
+ const currentUserInfo = useSelector(state => state.currentUserInfo);
+ const stringForUser = useStringForUser(currentUserInfo);
+
return (
<PasswordChangeModal
- currentUserInfo={currentUserInfo}
inputDisabled={inputDisabled}
changeUserPassword={callChangeUserPassword}
dispatchActionPromise={dispatchActionPromise}
popModal={modalContext.popModal}
+ stringForUser={stringForUser}
/>
);
},
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Mon, Dec 23, 2:44 AM (17 h, 56 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
2693281
Default Alt Text
D6470.diff (2 KB)
Attached To
Mode
D6470: [web] Show ENS names in PasswordChangeModal
Attached
Detach File
Event Timeline
Log In to Comment