Fix bugs crashed when refresh EditListingPage:

Cause: current user is null when the EditListing page got reloaded.
Solve: ensure current user and then pass in ID
This commit is contained in:
tam.vu 2019-03-29 15:27:50 +07:00 committed by Vesa Luusua
parent 84f272eaad
commit fa9cb85755

View file

@ -10,7 +10,7 @@ import {
LISTING_PAGE_PARAM_TYPE_NEW,
LISTING_PAGE_PARAM_TYPES,
} from '../../util/urlHelpers';
import { ensureListing } from '../../util/data';
import { ensureListing, ensureCurrentUser } from '../../util/data';
import { PayoutDetailsForm } from '../../forms';
import { Modal, NamedRedirect, Tabs } from '../../components';
@ -288,7 +288,7 @@ class EditListingWizard extends Component {
className={css.payoutDetails}
inProgress={fetchInProgress}
createStripeAccountError={errors ? errors.createStripeAccountError : null}
currentUserId={this.props.currentUser.id}
currentUserId={ensureCurrentUser(this.props.currentUser).id}
onChange={onPayoutDetailsFormChange}
onSubmit={this.handlePayoutSubmit}
/>