mirror of
https://github.com/ecency/ecency-mobile.git
synced 2024-12-02 11:15:35 +03:00
Merge pull request #2625 from ecency/sa/iap-bug
Allow purchase only for account purchase without login
This commit is contained in:
commit
f01d394925
@ -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) => {
|
||||
|
Loading…
Reference in New Issue
Block a user