From 90040910f9a7aaa45464f6190136ea47cfc2c53a Mon Sep 17 00:00:00 2001 From: Kimmo Puputti Date: Wed, 14 Mar 2018 11:03:29 +0200 Subject: [PATCH] Update current user having orders after creating enquiry This makes the enquiry tx page show the possible missing email verification modal right away. --- src/components/Topbar/Topbar.js | 4 +++- src/containers/ListingPage/ListingPage.duck.js | 3 ++- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/src/components/Topbar/Topbar.js b/src/components/Topbar/Topbar.js index b09c64e2..9332f878 100644 --- a/src/components/Topbar/Topbar.js +++ b/src/components/Topbar/Topbar.js @@ -199,8 +199,10 @@ class TopbarComponent extends Component { ); const isNotWhitelisted = !whitelistedPaths.includes(newLocation.pathname); + const showReminder = infoMissing && isNotWhitelisted && hasListingsOrOrders && showOnPathChange; + // Show reminder - if (infoMissing && isNotWhitelisted && hasListingsOrOrders && showOnPathChange) { + if (showReminder) { this.setState({ showMissingInformationReminder: true }); } } diff --git a/src/containers/ListingPage/ListingPage.duck.js b/src/containers/ListingPage/ListingPage.duck.js index 94ef6c50..3ae7305b 100644 --- a/src/containers/ListingPage/ListingPage.duck.js +++ b/src/containers/ListingPage/ListingPage.duck.js @@ -5,7 +5,7 @@ import { addMarketplaceEntities } from '../../ducks/marketplaceData.duck'; import { denormalisedResponseEntities } from '../../util/data'; import { TRANSITION_ENQUIRE } from '../../util/types'; import { LISTING_PAGE_PENDING_APPROVAL_VARIANT } from '../../util/urlHelpers'; -import { fetchCurrentUser } from '../../ducks/user.duck'; +import { fetchCurrentUser, fetchCurrentUserHasOrdersSuccess } from '../../ducks/user.duck'; const { UUID } = sdkTypes; @@ -167,6 +167,7 @@ export const sendEnquiry = (listingId, message) => (dispatch, getState, sdk) => // Send the message to the created transaction return sdk.messages.send({ transactionId, content: message }).then(() => { dispatch(sendEnquirySuccess()); + dispatch(fetchCurrentUserHasOrdersSuccess(true)); return transactionId; }); })