Skip to content

Commit

Permalink
Only remove the check for type but keep the sku filter (#2198)
Browse files Browse the repository at this point in the history
* Revert "Fix empty subscriptions list by removing filter (#2187)"

This reverts commit 12d0663.

* Update iap.ts

only filter on sku

* lint
  • Loading branch information
andresesfm authored Jan 11, 2023
1 parent 92d2e20 commit d8231d9
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion src/iap.ts
Original file line number Diff line number Diff line change
Expand Up @@ -197,7 +197,7 @@ export const getProducts = ({
} else {
items = (await RNIapIos.getItems(skus)) as Product[];
}
return items;
return items.filter((item: Product) => skus.includes(item.productId));
},
android: async () => {
const products = (
Expand Down Expand Up @@ -251,6 +251,10 @@ export const getSubscriptions = ({
items = (await RNIapIos.getItems(skus)) as SubscriptionIOS[];
}

items = items.filter((item: SubscriptionIOS) =>
skus.includes(item.productId),
);

return addSubscriptionPlatform(items, SubscriptionPlatform.ios);
},
android: async (): Promise<Subscription[]> => {
Expand Down

0 comments on commit d8231d9

Please sign in to comment.