From fa9cb85755cd87877352ddeb8c152c4c98a49fba Mon Sep 17 00:00:00 2001 From: "tam.vu" Date: Fri, 29 Mar 2019 15:27:50 +0700 Subject: [PATCH] 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 --- src/components/EditListingWizard/EditListingWizard.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/components/EditListingWizard/EditListingWizard.js b/src/components/EditListingWizard/EditListingWizard.js index 1ba249cc..d56897dc 100644 --- a/src/components/EditListingWizard/EditListingWizard.js +++ b/src/components/EditListingWizard/EditListingWizard.js @@ -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} />