fix: reset seller state after submitting an offer

This commit is contained in:
Jonathan Rainville 2019-05-24 11:29:25 -04:00
parent 233b60996c
commit 81fdc7dccb
No known key found for this signature in database
GPG Key ID: 5F4630B759727D9C
2 changed files with 3 additions and 1 deletions

View File

@ -8,6 +8,7 @@ import {
SET_ARBITRATOR
} from './constants';
import {RESET_STATE, PURGE_STATE} from "../network/constants";
import {ADD_OFFER_SUCCEEDED} from '../metadata/constants';
const DEFAULT_STATE = {
asset: '',
@ -60,6 +61,7 @@ function reducer(state = DEFAULT_STATE, action) {
username: action.username,
statusContactCode: action.statusContactCode
};
case ADD_OFFER_SUCCEEDED:
case PURGE_STATE:
case RESET_STATE: {
return DEFAULT_STATE;

View File

@ -38,7 +38,7 @@ class Margin extends Component {
};
componentDidMount() {
if (!this.props.seller.currency) {
if (!this.props.seller.currency && this.props.addOfferStatus !== States.success) {
this.props.wizard.previous();
} else {
this.setState({ready: true});