mirror of
https://github.com/wassname/talk.git
synced 2026-07-03 10:37:10 +08:00
ChangeUsername instead of setUsername
This commit is contained in:
@@ -51,10 +51,10 @@ class ChangeUsername extends React.Component {
|
||||
|
||||
saveChanges = async () => {
|
||||
const { newUsername } = this.state.formData;
|
||||
const { setUsername } = this.props;
|
||||
const { changeUsername } = this.props;
|
||||
|
||||
try {
|
||||
await setUsername(newUsername);
|
||||
await changeUsername(newUsername);
|
||||
this.props.notify(
|
||||
'success',
|
||||
t('talk-plugin-auth.change_username.changed_username_success_msg')
|
||||
@@ -179,7 +179,7 @@ class ChangeUsername extends React.Component {
|
||||
|
||||
ChangeUsername.propTypes = {
|
||||
root: PropTypes.object.isRequired,
|
||||
setUsername: PropTypes.func.isRequired,
|
||||
changeUsername: PropTypes.func.isRequired,
|
||||
notify: PropTypes.func.isRequired,
|
||||
username: PropTypes.string,
|
||||
emailAddress: PropTypes.string,
|
||||
|
||||
@@ -3,10 +3,10 @@ import { bindActionCreators } from 'redux';
|
||||
import { connect } from 'plugin-api/beta/client/hocs';
|
||||
import ChangeUsername from '../components/ChangeUsername';
|
||||
import { notify } from 'coral-framework/actions/notification';
|
||||
import { withSetUsername } from 'plugin-api/beta/client/hocs';
|
||||
import { withChangeUsername } from 'plugin-api/beta/client/hocs';
|
||||
|
||||
const mapDispatchToProps = dispatch => bindActionCreators({ notify }, dispatch);
|
||||
|
||||
export default compose(connect(null, mapDispatchToProps), withSetUsername)(
|
||||
export default compose(connect(null, mapDispatchToProps), withChangeUsername)(
|
||||
ChangeUsername
|
||||
);
|
||||
|
||||
Reference in New Issue
Block a user