remove the uri from the failed list if the user reattempts getting the same uri #151

Merged
akinwale merged 5 commits from purchase-uri-failures into master 2019-05-27 15:59:21 +02:00
2 changed files with 20 additions and 0 deletions
Showing only changes of commit 5cff70a26b - Show all commits

12
dist/bundle.es.js vendored
View file

@ -2917,6 +2917,18 @@ const defaultState$1 = {
purchasedStreamingUrls: {}
};
reducers$1[PURCHASE_URI_STARTED] = (state, action) => {
const { uri } = action.data;
const newFailedPurchaseUris = state.failedPurchaseUris.slice();
if (newFailedPurchaseUris.includes(uri)) {
newFailedPurchaseUris.splice(newFailedPurchaseUris.indexOf(uri), 1);
}
return _extends$4({}, state, {
failedPurchaseUris: newFailedPurchaseUris
});
};
reducers$1[PURCHASE_URI_COMPLETED] = (state, action) => {
const { uri, streamingUrl } = action.data;
const newPurchasedUris = state.purchasedUris.slice();

View file

@ -55,3 +55,11 @@ declare type PurchaseUriFailed = {
uri: string
},
};
declare type PurchaseUriStarted = {
type: ACTIONS.PURCHASE_URI_STARTED,
data: {
uri: string,
streamingUrl: string,
},
};