From a3872e71f5ae56939ffe150ef1f09d440dfc4966 Mon Sep 17 00:00:00 2001 From: Vesa Luusua Date: Mon, 25 Jun 2018 14:27:51 +0300 Subject: [PATCH 1/2] CheckoutPage: selected booking dates should be available after login --- src/containers/CheckoutPage/CheckoutPage.js | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/containers/CheckoutPage/CheckoutPage.js b/src/containers/CheckoutPage/CheckoutPage.js index 242c7f76..ec2648f1 100644 --- a/src/containers/CheckoutPage/CheckoutPage.js +++ b/src/containers/CheckoutPage/CheckoutPage.js @@ -75,13 +75,17 @@ export class CheckoutPageComponent extends Component { const { bookingData, bookingDates, listing, fetchSpeculatedTransaction, history } = this.props; // Browser's back navigation should not rewrite data in session store. // Action is 'POP' on both history.back() and page refresh cases. - const hasNavigatedThroughLink = history.action === 'PUSH'; + // Action is 'PUSH' when user has directed through a link + // Action is 'REPLACE' when user has directed through login/signup process + const hasNavigatedThroughLink = history.action === 'PUSH' || history.action === 'REPLACE'; const hasDataInProps = !!(bookingData && bookingDates && listing) && hasNavigatedThroughLink; if (hasDataInProps) { + // Store data only if data is passed through props and user has navigated through a link. storeData(bookingData, bookingDates, listing, STORAGE_KEY); } + // NOTE: stored data can be empty if user has already successfully completed transaction. const pageData = hasDataInProps ? { bookingData, bookingDates, listing } : storedData(STORAGE_KEY); From db776d4db9a1dd8c68a02460f742e560335971ba Mon Sep 17 00:00:00 2001 From: Vesa Luusua Date: Mon, 25 Jun 2018 14:30:51 +0300 Subject: [PATCH 2/2] Update Change log --- CHANGELOG.md | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 1b7768a3..f726a910 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -14,9 +14,11 @@ way to update this template, but currently, we follow a pattern: ## Upcoming version * [fix] Improve slug creation (slashes were breaking rendering in some environments) - [#850](https://github.com/sharetribe/flex-template-web/pull/850) + [#850](https://github.com/sharetribe/flex-template-web/pull/850) * [fix] Anonymous user should see contact link on UserCard - [#851](https://github.com/sharetribe/flex-template-web/pull/851) + [#851](https://github.com/sharetribe/flex-template-web/pull/851) +* [fix] Persisting booking request details across authentication + [#852](https://github.com/sharetribe/flex-template-web/pull/852) ## v1.0.0