From bd0db0137ecc0d89286ab7091fac9b09faa76532 Mon Sep 17 00:00:00 2001 From: Matt Brennan Date: Tue, 6 Nov 2018 12:17:24 +0000 Subject: [PATCH] properly collate state updates for section switch --- components/x-gift-article/src/GiftArticle.jsx | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/components/x-gift-article/src/GiftArticle.jsx b/components/x-gift-article/src/GiftArticle.jsx index e9357d662..94c41f21d 100644 --- a/components/x-gift-article/src/GiftArticle.jsx +++ b/components/x-gift-article/src/GiftArticle.jsx @@ -27,15 +27,20 @@ const withGiftFormActions = withActions( showNonGiftUrlSection() { return async (state) => { + const update = updaters.showNonGiftUrlSection(state); + if (!state.isNonGiftUrlShortened) { const { url, isShortened } = await api.getShorterUrl(state.urls.nonGift); if (isShortened) { - return updaters.setShortenedNonGiftUrl(url)(state); + Object.assign( + update, + updaters.setShortenedNonGiftUrl(url)(state) + ); } } - return updaters.showNonGiftUrlSection(state); + return update; } },