Wallet history refresh OK

This commit is contained in:
Brice Zele 2020-11-15 18:22:59 +01:00
parent b0f0c6c8be
commit 1241951647
6 changed files with 68 additions and 18 deletions

View File

@ -93,6 +93,38 @@ class WalletDetail extends Component {
else else
this.props.getWalletTransactionHistory(this.props.navigation.state.params.wallet.id, false); this.props.getWalletTransactionHistory(this.props.navigation.state.params.wallet.id, false);
} }
this.willFocus = this.props.navigation.addListener(
'willFocus',
payload => {
const { result } = this.props;
console.log("will focus");
if (result !== null) {
if (typeof result.response !== 'undefined') {
const wallet = result.response[0];
readUser().then((user) => {
if (user !== null && user !== undefined) {
if (user.category !== undefined) {
switch (user.category) {
case "super":
this.props.getHyperSuperTransactionHistoryAction(result.response.id, false);
break;
case "hyper":
this.props.getHyperSuperTransactionHistoryAction(user.network_id, true);
break;
}
this.setState({});
}
}
});
this.setState({
wallet: wallet,
isTriggerRefresh: false
})
}
}
});
} }
/* /*
static options(passProps) { static options(passProps) {

View File

@ -106,15 +106,20 @@ class WalletDetailUser extends Component {
this.props.getWalletDetailActivated(this.props.navigation.state.params.userId, null); this.props.getWalletDetailActivated(this.props.navigation.state.params.userId, null);
this.props.getUserIdentificationResetAction(); this.props.getUserIdentificationResetAction();
readUser().then((user) => { this.willFocus = this.props.navigation.addListener(
if (user) { 'willFocus',
if (user !== undefined) { payload => {
this.setState({user}); readUser().then((user) => {
this.props.getUserIdentificationAction(user.phone); if (user) {
this.props.getWalletTransactionHistoryUser(user.id); if (user !== undefined) {
} this.setState({user});
} this.props.getUserIdentificationAction(user.phone);
}); this.props.getWalletTransactionHistoryUser(user.id);
}
}
});
});
} }
static navigatorStyle = { static navigatorStyle = {

View File

@ -442,6 +442,7 @@ class EnvoieWalletToWalletUser extends Component {
this.props.getCommissionUserWalletToWalletAction({ this.props.getCommissionUserWalletToWalletAction({
type: 1, type: 1,
network_destinataire: (this.state.walletActifs.filter(element => element.name === this.state.walletActifSelect))[0].id,
id_wallet_user: this.state.wallet.id, id_wallet_user: this.state.wallet.id,
final_country: (this.state.paysDestination.filter(element => element.name === this.state.paysDestinationSelect))[0].id, final_country: (this.state.paysDestination.filter(element => element.name === this.state.paysDestinationSelect))[0].id,
id_destinataire: this.state.numeroTelephoneOrWalletCode, id_destinataire: this.state.numeroTelephoneOrWalletCode,
@ -564,8 +565,8 @@ class EnvoieWalletToWalletUser extends Component {
onChangeText={(value, index, data) => { onChangeText={(value, index, data) => {
this.setState({ typeIdDestinataireSelect: value }); this.setState({ typeIdDestinataireSelect: value });
}} }}
valueExtractor={(value) => { return value.name }} valueExtractor={(value) => { return I18n.t(value.name) }}
labelExtractor={(value) => { return value.name }} labelExtractor={(value) => { return I18n.t(value.name) }}
/> />
</Animatable.View> </Animatable.View>

View File

@ -369,6 +369,14 @@ export const optionRetraitUserScreen = {
screen: route.retraitCarteVersWalletUser, screen: route.retraitCarteVersWalletUser,
icon: 'credit-card', icon: 'credit-card',
title: 'WITHDRAWAL_CARD_TO_WALLET', title: 'WITHDRAWAL_CARD_TO_WALLET',
}, {
screen: '',
icon: 'credit-card',
title: 'WITHDRAWAL_BANK_TO_WALLET',
}, {
screen: '',
icon: 'credit-card',
title: 'WITHDRAWAL_BANK_TO_CASH',
}, },
] ]
} }
@ -393,13 +401,13 @@ export const optionDepotUserScreen = {
icon: 'credit-card', icon: 'credit-card',
title: 'DEPOSIT_TO_CARD', title: 'DEPOSIT_TO_CARD',
}, },
{ {
type: 'WALLET_TO_BANK', type: 'WALLET_TO_BANK',
screen: route.operateurOptionSelect, screen: route.operateurOptionSelect,
icon: 'bank-transfer-in', icon: 'bank-transfer-in',
title: 'DEPOSIT_TO_BANK', title: 'DEPOSIT_TO_BANK',
subScreenOption: optionWalletToBank subScreenOption: optionWalletToBank
}, },
] ]
} }

View File

@ -93,6 +93,8 @@
"WITHDRAWAL_CARD_TO_WALLET": "Withdrawal card to wallet", "WITHDRAWAL_CARD_TO_WALLET": "Withdrawal card to wallet",
"WITHDRAWAL_CARD_TO_WALLET_DESCRIPTION": "Withdrawal money from your card to your wallet", "WITHDRAWAL_CARD_TO_WALLET_DESCRIPTION": "Withdrawal money from your card to your wallet",
"WITHDRAWAL_CARD_TO_CASH": "Withdrawal card to cash", "WITHDRAWAL_CARD_TO_CASH": "Withdrawal card to cash",
"WITHDRAWAL_BANK_TO_WALLET": "Withdrawal bank to wallet",
"WITHDRAWAL_BANK_TO_CASH": "Withdrawal bank to cash",
"WITHDRAWAL_CARD_TO_CASH_AGENT": "Withdrawal card to cash", "WITHDRAWAL_CARD_TO_CASH_AGENT": "Withdrawal card to cash",
"WITHDRAWAL_CARD_TO_CASH_DESCRIPTION": "Withdrawal money from card to cash", "WITHDRAWAL_CARD_TO_CASH_DESCRIPTION": "Withdrawal money from card to cash",
"WITHDRAWAL_CARD_TO_CASH_DESCRIPTION_AGENT": "Withdrawal money from card to cash", "WITHDRAWAL_CARD_TO_CASH_DESCRIPTION_AGENT": "Withdrawal money from card to cash",

View File

@ -97,6 +97,8 @@
"WITHDRAWAL_WALLET_TO_CASH": "Retrait de votre wallet vers cash", "WITHDRAWAL_WALLET_TO_CASH": "Retrait de votre wallet vers cash",
"WITHDRAWAL_WALLET_TO_CASH_DESCRIPTION": "Retirer de l'argent de votre Wallet vers cash", "WITHDRAWAL_WALLET_TO_CASH_DESCRIPTION": "Retirer de l'argent de votre Wallet vers cash",
"WITHDRAWAL_CARD_TO_WALLET": "Retrait de votre carte vers wallet", "WITHDRAWAL_CARD_TO_WALLET": "Retrait de votre carte vers wallet",
"WITHDRAWAL_BANK_TO_WALLET": "Retrait de votre banque vers wallet",
"WITHDRAWAL_BANK_TO_CASH": "Retrait de votre banque vers cash",
"WITHDRAWAL_CARD_TO_WALLET_DESCRIPTION": "Retrait d'argent de votre carte vers wallet", "WITHDRAWAL_CARD_TO_WALLET_DESCRIPTION": "Retrait d'argent de votre carte vers wallet",
"WITHDRAWAL_CARD_TO_CASH": "Retrait de votre carte vers cash", "WITHDRAWAL_CARD_TO_CASH": "Retrait de votre carte vers cash",
"WITHDRAWAL_CARD_TO_CASH_AGENT": "Retrait carte vers cash", "WITHDRAWAL_CARD_TO_CASH_AGENT": "Retrait carte vers cash",