From 3d724a4bb7c6407593033da54beb2d7dfe275c11 Mon Sep 17 00:00:00 2001 From: Travis Eden Date: Wed, 6 Jun 2018 23:37:48 -0400 Subject: [PATCH] implement failSilently option in doClaimRewardType and set true in doClaimEligiblePurchaseRewards --- src/renderer/redux/actions/rewards.js | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/src/renderer/redux/actions/rewards.js b/src/renderer/redux/actions/rewards.js index 581772a3d..a20bfcb48 100644 --- a/src/renderer/redux/actions/rewards.js +++ b/src/renderer/redux/actions/rewards.js @@ -27,7 +27,7 @@ export function doRewardList() { }; } -export function doClaimRewardType(rewardType) { +export function doClaimRewardType(rewardType, options) { return (dispatch, getState) => { const state = getState(); const unclaimedRewards = selectUnclaimedRewards(state); @@ -73,7 +73,10 @@ export function doClaimRewardType(rewardType) { const failure = error => { dispatch({ type: ACTIONS.CLAIM_REWARD_FAILURE, - data: { reward, error }, + data: { + reward, + error: !options || !options.failSilently ? error : undefined, + }, }); }; @@ -95,7 +98,7 @@ export function doClaimEligiblePurchaseRewards() { dispatch(doClaimRewardType(rewards.TYPE_FIRST_STREAM)); } else { [rewards.TYPE_MANY_DOWNLOADS, rewards.TYPE_FEATURED_DOWNLOAD].forEach(type => { - dispatch(doClaimRewardType(type)); + dispatch(doClaimRewardType(type, { failSilently: true })); }); } };