Merge pull request #758 from sharetribe/update-has-orders-after-enquiry

Update current user having orders after creating enquiry
This commit is contained in:
Kimmo Puputti 2018-03-14 11:24:59 +02:00 committed by GitHub
commit fb56e5d4d8
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 5 additions and 2 deletions

View file

@ -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 });
}
}

View file

@ -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;
});
})