ChangeUsername instead of setUsername

This commit is contained in:
okbel
2018-04-30 20:20:58 -03:00
parent 5dbf379bde
commit 4cd7ad9c33
2 changed files with 5 additions and 5 deletions
@@ -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
);