Commit 29139c2d authored by William Goszal's avatar William Goszal 🚴

matiin spinner=true saat get location di account

parent f301b9c8
...@@ -85,10 +85,7 @@ class Account extends React.Component { ...@@ -85,10 +85,7 @@ class Account extends React.Component {
} }
_getCurrentPosisition = async () => { _getCurrentPosisition = async () => {
try { try {
this.setState({
spinner: true,
})
let location = await Location.getCurrentPositionAsync({ let location = await Location.getCurrentPositionAsync({
accuracy: Location.Accuracy.Highest accuracy: Location.Accuracy.Highest
}) })
...@@ -129,16 +126,18 @@ class Account extends React.Component { ...@@ -129,16 +126,18 @@ class Account extends React.Component {
let params = Object.assign(requestParams, { let params = Object.assign(requestParams, {
session_id: this.props.session_id, session_id: this.props.session_id,
}) })
console.log("start processing claim_old_balance")
Axios.post(this.props.BASE_URL + 'crm/v2/card/claim_old_balance', params).then(res => { Axios.post(this.props.BASE_URL + 'crm/v2/card/claim_old_balance', params).then(res => {
this.setState({spinner: false}) console.log("success processing claim_old_balance")
this._getProfile() this.setState({spinner: false})
this._getProfile()
// Alert.alert(i18n.t('success'), i18n.t('alertclaimcredit')) // Alert.alert(i18n.t('success'), i18n.t('alertclaimcredit'))
}).catch(error => { }).catch(error => {
this.setState({spinner: false}) console.log("failed processing claim_old_balance")
this._getProfile() this.setState({spinner: false})
let response = error.response.data this._getProfile()
Alert.alert(error, response.msg) let response = error.response.data
Alert.alert(error, response.msg)
}) })
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment