Always resolve claims on discover page

This commit is contained in:
6ea86b96 2017-06-08 12:10:58 +07:00
parent 04c4988a9a
commit 193738083f

View file

@ -11,6 +11,7 @@ import { selectResolvingUris } from "selectors/content";
import { selectCostInfoForUri } from "selectors/cost_info";
import { doOpenModal } from "actions/app";
import { doClaimEligiblePurchaseRewards } from "actions/rewards";
import batchActions from "util/batchActions";
export function doResolveUri(uri) {
return function(dispatch, getState) {
@ -63,20 +64,28 @@ export function doFetchFeaturedUris() {
const success = ({ Categories, Uris }) => {
let featuredUris = {};
const actions = [];
Categories.forEach(category => {
if (Uris[category] && Uris[category].length) {
featuredUris[category] = Uris[category];
const uris = Uris[category];
featuredUris[category] = uris;
uris.forEach(uri => {
actions.push(doResolveUri(uri));
});
}
});
dispatch({
actions.push({
type: types.FETCH_FEATURED_CONTENT_COMPLETED,
data: {
categories: Categories,
uris: featuredUris,
},
});
dispatch(batchActions(...actions));
};
const failure = () => {