Skip to content

Commit

Permalink
properly collate state updates for section switch
Browse files Browse the repository at this point in the history
  • Loading branch information
apaleslimghost committed Nov 6, 2018
1 parent 2db67a7 commit bd0db01
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions components/x-gift-article/src/GiftArticle.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
},

Expand Down

0 comments on commit bd0db01

Please sign in to comment.