correction des bugs stabilisation android
This commit is contained in:
parent
b29b30ec6a
commit
edafab7025
4
App.js
4
App.js
|
@ -242,7 +242,7 @@ const AppAgentStack = createDrawerNavigator({
|
|||
activeColor: '#f0edf6',
|
||||
inactiveColor: '#3e2465',
|
||||
barStyle: { backgroundColor: '#694fad' },
|
||||
headerLeft: (<HeaderBackButton />),
|
||||
/* headerLeft: (<HeaderBackButton />), */
|
||||
drawerLabel: I18n.t('CREDIT_MANAGE'),
|
||||
drawerIcon: ({ tintColor }) => (
|
||||
<Icon
|
||||
|
@ -455,6 +455,8 @@ class App extends React.Component {
|
|||
params: { routeName, params }
|
||||
});
|
||||
}
|
||||
if (typeof this.refs.navigator !== 'undefined') {
|
||||
}
|
||||
};
|
||||
|
||||
handleDeepLink = (openResult) => {
|
||||
|
|
File diff suppressed because one or more lines are too long
|
@ -49,7 +49,7 @@ import {
|
|||
CASSER_EPARGNE_USER_PENDING,
|
||||
CASSER_EPARGNE_USER_SUCCESS,
|
||||
CASSER_EPARGNE_USER_ERROR,
|
||||
CASSER_EPARGNE_USER_RESET, GET_NANO_CREDIT_ACCOUNT_USER_PENDING, GET_NANO_CREDIT_ACCOUNT_USER_SUCCESS, GET_NANO_CREDIT_ACCOUNT_USER_ERROR, GET_NANO_CREDIT_ACCOUNT_USER_RESET
|
||||
CASSER_EPARGNE_USER_RESET, GET_NANO_CREDIT_ACCOUNT_USER_PENDING, GET_NANO_CREDIT_ACCOUNT_USER_SUCCESS, GET_NANO_CREDIT_ACCOUNT_USER_ERROR, GET_NANO_CREDIT_ACCOUNT_USER_RESET, GET_NANO_CREDIT_HISTORY_USER_PENDING, GET_NANO_CREDIT_HISTORY_USER_SUCCESS, GET_NANO_CREDIT_HISTORY_USER_RESET, GET_NANO_CREDIT_HISTORY_USER_ERROR
|
||||
} from "../types/NanoCreditType";
|
||||
|
||||
export const fetchCreateGroupPending = () => ({
|
||||
|
@ -331,4 +331,23 @@ export const fetchGetNanoCreditUserAccountError = (error) => ({
|
|||
|
||||
export const fetchGetNanoCreditUserAccountReset = () => ({
|
||||
type: GET_NANO_CREDIT_ACCOUNT_USER_RESET
|
||||
});
|
||||
|
||||
|
||||
export const fetchGetNanoCreditUserHistoryPending = () => ({
|
||||
type: GET_NANO_CREDIT_HISTORY_USER_PENDING
|
||||
});
|
||||
|
||||
export const fetchGetNanoCreditUserHistorySuccess = (res) => ({
|
||||
type: GET_NANO_CREDIT_HISTORY_USER_SUCCESS,
|
||||
result: res,
|
||||
});
|
||||
|
||||
export const fetchGetNanoCreditUserHistoryError = (error) => ({
|
||||
type: GET_NANO_CREDIT_HISTORY_USER_ERROR,
|
||||
result: error
|
||||
});
|
||||
|
||||
export const fetchGetNanoCreditUserHistoryReset = () => ({
|
||||
type: GET_NANO_CREDIT_HISTORY_USER_RESET
|
||||
});
|
|
@ -0,0 +1,33 @@
|
|||
import { GET_NANO_CREDIT_HISTORY_USER_ERROR, GET_NANO_CREDIT_HISTORY_USER_PENDING, GET_NANO_CREDIT_HISTORY_USER_RESET, GET_NANO_CREDIT_HISTORY_USER_SUCCESS } from "../types/NanoCreditType";
|
||||
|
||||
const initialState = {
|
||||
loading: false,
|
||||
result: null,
|
||||
error: null
|
||||
};
|
||||
|
||||
export default (state = initialState, action) => {
|
||||
switch (action.type) {
|
||||
case GET_NANO_CREDIT_HISTORY_USER_PENDING: return {
|
||||
...state,
|
||||
loading: true
|
||||
}
|
||||
case GET_NANO_CREDIT_HISTORY_USER_SUCCESS: return {
|
||||
...state,
|
||||
loading: false,
|
||||
result: action.result.data,
|
||||
error: null
|
||||
}
|
||||
case GET_NANO_CREDIT_HISTORY_USER_ERROR: return {
|
||||
...state,
|
||||
loading: false,
|
||||
result: null,
|
||||
error: action.result
|
||||
}
|
||||
case GET_NANO_CREDIT_HISTORY_USER_RESET: return initialState;
|
||||
|
||||
default: {
|
||||
return state;
|
||||
}
|
||||
}
|
||||
};
|
|
@ -72,3 +72,8 @@ export const GET_NANO_CREDIT_ACCOUNT_USER_PENDING = 'GET_NANO_CREDIT_ACCOUNT_USE
|
|||
export const GET_NANO_CREDIT_ACCOUNT_USER_SUCCESS = 'GET_NANO_CREDIT_ACCOUNT_USER_SUCCESS';
|
||||
export const GET_NANO_CREDIT_ACCOUNT_USER_ERROR = 'GET_NANO_CREDIT_ACCOUNT_USER_ERROR';
|
||||
export const GET_NANO_CREDIT_ACCOUNT_USER_RESET = 'GET_NANO_CREDIT_ACCOUNT_USER_RESET';
|
||||
|
||||
export const GET_NANO_CREDIT_HISTORY_USER_PENDING = 'GET_NANO_CREDIT_HISTORY_USER_PENDING';
|
||||
export const GET_NANO_CREDIT_HISTORY_USER_SUCCESS = 'GET_NANO_CREDIT_HISTORY_USER_SUCCESS';
|
||||
export const GET_NANO_CREDIT_HISTORY_USER_ERROR = 'GET_NANO_CREDIT_HISTORY_USER_ERROR';
|
||||
export const GET_NANO_CREDIT_HISTORY_USER_RESET = 'GET_NANO_CREDIT_HISTORY_USER_RESET';
|
||||
|
|
|
@ -53,7 +53,7 @@ export default class SplashScreen extends Component {
|
|||
};
|
||||
workUserResult(result) {
|
||||
console.log("SPLASHSCREEN PROPS", this.props);
|
||||
if (this.props.navigation.state.params.hasOwnProperty('routeName')) {
|
||||
if (typeof this.props.navigation.state.params !== 'undefined') {
|
||||
this.props.navigation.navigate(this.props.navigation.state.params.routeName, {
|
||||
id: this.props.navigation.state.params.params.id
|
||||
});
|
||||
|
|
|
@ -13,7 +13,7 @@ import { baseUrl } from '../../webservice/IlinkConstants';
|
|||
import { IlinkEmitter } from "../../utils/events";
|
||||
import { Provider, Appbar } from 'react-native-paper';
|
||||
import { readUser } from '../../webservice/AuthApi';
|
||||
import { getNanoCreditAccountReset, getNanoCreditAccountAction } from '../../webservice/user/NanoCreditApi';
|
||||
import { getNanoCreditAccountReset, getNanoCreditAccountAction, getNanoCreditUserHistoryAction, getNanoCreditUserHistoryReset } from '../../webservice/user/NanoCreditApi';
|
||||
import _ from 'lodash';
|
||||
import Icons from 'react-native-vector-icons/Ionicons'
|
||||
import { FontWeight, Typography } from '../../config/typography';
|
||||
|
@ -47,10 +47,15 @@ class WalletOptionSelect extends Component {
|
|||
IlinkEmitter.on("langueChange", this.updateLangue.bind(this));
|
||||
|
||||
this.props.getNanoCreditAccountReset();
|
||||
this.props.getNanoCreditUserHistoryReset();
|
||||
|
||||
readUser().then((user) => {
|
||||
if (user) {
|
||||
if (user !== undefined) {
|
||||
this.props.getNanoCreditAccountAction(user.id);
|
||||
if (typeof user.category === 'undefined') {
|
||||
this.props.getNanoCreditAccountAction(user.id);
|
||||
this.props.getNanoCreditUserHistoryAction(user.id);
|
||||
}
|
||||
this.setState({ user });
|
||||
}
|
||||
}
|
||||
|
@ -59,9 +64,11 @@ class WalletOptionSelect extends Component {
|
|||
this.willFocus = this.props.navigation.addListener(
|
||||
'willFocus',
|
||||
payload => {
|
||||
console.log("WIIL FOCUS CALL");
|
||||
readUser().then((user) => {
|
||||
if (user) {
|
||||
if (user !== undefined) {
|
||||
this.props.getNanoCreditUserHistoryAction(user.id);
|
||||
this.props.getNanoCreditAccountAction(user.id);
|
||||
}
|
||||
}
|
||||
|
@ -422,6 +429,9 @@ const mapStateToProps = state => ({
|
|||
const mapDispatchToProps = dispatch => bindActionCreators({
|
||||
getNanoCreditAccountAction,
|
||||
getNanoCreditAccountReset,
|
||||
|
||||
getNanoCreditUserHistoryAction,
|
||||
getNanoCreditUserHistoryReset
|
||||
}, dispatch);
|
||||
|
||||
export default connect(mapStateToProps, mapDispatchToProps)(connectActionSheet(WalletOptionSelect));
|
||||
|
|
|
@ -66,6 +66,7 @@ export const casserEpargneUrl = testBaseUrl + '/walletService/groups/nanoCredit/
|
|||
export const saveOnesignalIds = testBaseUrl + '/notificationService/onesignal';
|
||||
export const getNotificationUrl = testBaseUrl + '/notificationService/notifications';
|
||||
export const getNanoCreditAccount = testBaseUrl + '/walletService/groups/nanoCredit/accounts';
|
||||
export const getNanoCreditUserHistoryUrl = testBaseUrl + '/walletService/groups/nanoCredit/all_demands';
|
||||
|
||||
export const authKeyUrl = testBaseUrl + '/oauth/token';
|
||||
export const videoUrl = "https://www.youtube.com/watch?v=wwGPDPsSLWY";
|
||||
|
|
|
@ -2,8 +2,8 @@
|
|||
import axios from "axios";
|
||||
import I18n from 'react-native-i18n';
|
||||
import { store } from "../../redux/store";
|
||||
import { fetchCautionCreditDemandUserError, fetchCautionCreditDemandUserPending, fetchCautionCreditDemandUserReset, fetchCautionCreditDemandUserSuccess, fetchGetDemandsGroupError, fetchGetDemandsGroupPending, fetchGetDemandsGroupReset, fetchGetDemandsGroupSuccess, fetchGetUniqueDemandsGroupError, fetchGetUniqueDemandsGroupPending, fetchGetUniqueDemandsGroupReset, fetchGetUniqueDemandsGroupSuccess, fetchGetUserGroupDetailError, fetchGetUserGroupDetailPending, fetchGetUserGroupDetailReset, fetchGetUserGroupDetailSuccess, fetchEpargnerArgentUserPending, fetchEpargnerArgentUserSuccess, fetchEpargnerArgentUserError, fetchEpargnerArgentUserReset, fetchCasserEpargneUserPending, fetchCasserEpargneUserSuccess, fetchCasserEpargneUserError, fetchCasserEpargneUserReset, fetchGetNanoCreditUserAccountPending, fetchGetNanoCreditUserAccountSuccess, fetchGetNanoCreditUserAccountError, fetchGetNanoCreditUserAccountReset } from "../../redux/actions/NanoCreditAction";
|
||||
import { cautionCreditDemandtUrl, getCreditDemand, groupUrl, refundCreditDemandUrl, epargnerArgentUrl, casserEpargneUrl, getNanoCreditAccount } from "../IlinkConstants";
|
||||
import { fetchCautionCreditDemandUserError, fetchCautionCreditDemandUserPending, fetchCautionCreditDemandUserReset, fetchCautionCreditDemandUserSuccess, fetchGetDemandsGroupError, fetchGetDemandsGroupPending, fetchGetDemandsGroupReset, fetchGetDemandsGroupSuccess, fetchGetUniqueDemandsGroupError, fetchGetUniqueDemandsGroupPending, fetchGetUniqueDemandsGroupReset, fetchGetUniqueDemandsGroupSuccess, fetchGetUserGroupDetailError, fetchGetUserGroupDetailPending, fetchGetUserGroupDetailReset, fetchGetUserGroupDetailSuccess, fetchEpargnerArgentUserPending, fetchEpargnerArgentUserSuccess, fetchEpargnerArgentUserError, fetchEpargnerArgentUserReset, fetchCasserEpargneUserPending, fetchCasserEpargneUserSuccess, fetchCasserEpargneUserError, fetchCasserEpargneUserReset, fetchGetNanoCreditUserAccountPending, fetchGetNanoCreditUserAccountSuccess, fetchGetNanoCreditUserAccountError, fetchGetNanoCreditUserAccountReset, fetchGetNanoCreditUserHistoryPending, fetchGetNanoCreditUserHistorySuccess, fetchGetNanoCreditUserHistoryError, fetchGetNanoCreditUserHistoryReset } from "../../redux/actions/NanoCreditAction";
|
||||
import { cautionCreditDemandtUrl, getCreditDemand, groupUrl, refundCreditDemandUrl, getNanoCreditUserHistoryUrl, epargnerArgentUrl, casserEpargneUrl, getNanoCreditAccount } from "../IlinkConstants";
|
||||
|
||||
export const getNanoCreditDemandsAction = (id) => {
|
||||
|
||||
|
@ -45,7 +45,10 @@ export const getNanoCreditDemandsReset = () => {
|
|||
export const getNanoCreditUniqueDemandsAction = (id) => {
|
||||
|
||||
const auth = store.getState().authKeyReducer;
|
||||
const authKey = auth !== null ? `${auth.authKey.token_type} ${auth.authKey.access_token}` : '';
|
||||
const authKey = auth !== null ?
|
||||
auth.authKey !== null ?
|
||||
`${auth.authKey.token_type} ${auth.authKey.access_token}` :
|
||||
'' : '';
|
||||
|
||||
return dispatch => {
|
||||
dispatch(fetchGetUniqueDemandsGroupPending());
|
||||
|
@ -270,4 +273,42 @@ export const getNanoCreditAccountReset = () => {
|
|||
return dispatch => {
|
||||
dispatch(fetchGetNanoCreditUserAccountReset());
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
export const getNanoCreditUserHistoryAction = (idUser) => {
|
||||
|
||||
const auth = store.getState().authKeyReducer;
|
||||
const authKey = auth !== null ? `${auth.authKey.token_type} ${auth.authKey.access_token}` : '';
|
||||
|
||||
return dispatch => {
|
||||
dispatch(fetchGetNanoCreditUserHistoryPending());
|
||||
|
||||
axios({
|
||||
url: `${getNanoCreditUserHistoryUrl}/${idUser}`,
|
||||
method: 'GET',
|
||||
headers: {
|
||||
'Authorization': authKey,
|
||||
'X-Localization': I18n.currentLocale()
|
||||
},
|
||||
})
|
||||
.then(response => {
|
||||
console.log(response);
|
||||
dispatch(fetchGetNanoCreditUserHistorySuccess(response));
|
||||
})
|
||||
.catch(error => {
|
||||
if (error.response)
|
||||
dispatch(fetchGetNanoCreditUserHistoryError(error.response));
|
||||
else if (error.request)
|
||||
dispatch(fetchGetNanoCreditUserHistoryError(error.request))
|
||||
else
|
||||
dispatch(fetchGetNanoCreditUserHistoryError(error.message))
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
export const getNanoCreditUserHistoryReset = () => {
|
||||
return dispatch => {
|
||||
dispatch(fetchGetNanoCreditUserHistoryReset());
|
||||
}
|
||||
}
|
Loading…
Reference in New Issue