Skip to content

Commit

Permalink
Redirect after submission
Browse files Browse the repository at this point in the history
  • Loading branch information
Aman035 committed Nov 26, 2021
1 parent 7717821 commit 325e403
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions src/components/profile/newid.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ import './newId.css';
import FileUploadIcon from '@mui/icons-material/FileUpload';
import { connect } from 'react-redux';
import { addId } from '../../redux/actions/user';
import { useHistory } from 'react-router-dom';

const mapstateToProps = state => ({
Issuer : state.Issuer,
Expand All @@ -18,7 +19,7 @@ const mapDispatchToProps = (dispatch) => ({
});

const NewId = props => {

const history = useHistory();
const [load , setLoad] = useState(false);
const [details , setdetails] = useState({
identity : {
Expand Down Expand Up @@ -71,7 +72,7 @@ const NewId = props => {
}
setLoad(true);
await props.addId(details.identity.address , details.file.buffer, props.User.info.address , props.User.info.publicKey , details.identity.id);
setLoad(false);
history.push('/profile');
}

return(
Expand Down

0 comments on commit 325e403

Please sign in to comment.