Merge pull request #2625 from ecency/sa/iap-bug

Allow purchase only for account purchase without login
This commit is contained in:
Feruz M 2023-03-04 08:11:51 +02:00 committed by GitHub
commit f01d394925
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -254,8 +254,17 @@ class InAppPurchaseContainer extends Component {
};
_buyItem = async (sku) => {
const { navigation } = this.props;
const { navigation, isLoggedIn, intl } = this.props;
const { unconsumedPurchases } = this.state;
// if user is not loggedIn and purchase is other than account purchase
// add more skus here for account purchase
if (!isLoggedIn && sku !== '999accounts') {
Alert.alert(
intl.formatMessage({ id: 'login.not_loggedin_alert' }),
intl.formatMessage({ id: 'login.not_loggedin_alert_desc' }),
);
return;
}
if (sku !== 'freePoints') {
this.setState({ isProcessing: true });
@ -363,6 +372,7 @@ class InAppPurchaseContainer extends Component {
const mapStateToProps = (state) => ({
currentAccount: state.account.currentAccount,
isLoggedIn: state.application.isLoggedIn,
});
const mapHooksToProps = (props) => {